feat: tested
This commit is contained in:
33
main.go
33
main.go
@@ -10,38 +10,9 @@ import (
|
||||
|
||||
func main() {
|
||||
key := []byte{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
}
|
||||
fmt.Println(hex.EncodeToString(key))
|
||||
|
||||
encFs := encfs.NewEncFs(key)
|
||||
encFs2 := encfs.NewEncFs(nil)
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------------
|
||||
encFile1, err := encFs2.Create("test1")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
encFile1.Write([]byte("hello world"))
|
||||
encFile1.Write([]byte("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
|
||||
encFile1.WriteAt([]byte("TEST"), 10)
|
||||
encFile1.Write([]byte("------"))
|
||||
encFile1.Close()
|
||||
|
||||
encFile2, err := encFs2.Create("test2")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
encFile2.Write([]byte("hello world"))
|
||||
seekI, err := encFile2.Seek(2, 0)
|
||||
fmt.Println(seekI, ", ", err)
|
||||
encFile2.Write([]byte("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
|
||||
encFile2.Write([]byte("------"))
|
||||
encFile2.Close()
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
func() {
|
||||
encFile, err := encFs.Create("test")
|
||||
@@ -80,4 +51,6 @@ func main() {
|
||||
fmt.Println(readLen, err)
|
||||
fmt.Println(string(buff))
|
||||
}()
|
||||
|
||||
encFs.Remove("test")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user