diff options
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/atomicrename/main.go | 7 | ||||
| -rw-r--r-- | contrib/findholes/holes/holes.go | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/contrib/atomicrename/main.go b/contrib/atomicrename/main.go index 394753b..337371c 100644 --- a/contrib/atomicrename/main.go +++ b/contrib/atomicrename/main.go @@ -4,7 +4,6 @@ import ( "bytes" "flag" "fmt" - "io/ioutil" "os" "strings" "sync/atomic" @@ -49,7 +48,7 @@ func main() { srcFiles[srcName] = struct{}{} buf := bytes.Repeat([]byte("_"), i) buf = append(buf, hello...) - if err := ioutil.WriteFile(srcName, buf, 0600); err != nil { + if err := os.WriteFile(srcName, buf, 0600); err != nil { panic(err) } fmt.Print(".") @@ -58,7 +57,7 @@ func main() { // prepare destination file const dstName = "dst.atomicrename" - if err := ioutil.WriteFile(dstName, hello, 0600); err != nil { + if err := os.WriteFile(dstName, hello, 0600); err != nil { panic(err) } @@ -69,7 +68,7 @@ func main() { // read thread go func() { for atomic.LoadInt32(&running) == 1 { - have, err := ioutil.ReadFile(dstName) + have, err := os.ReadFile(dstName) if err != nil { fmt.Println(err) stats.readError++ diff --git a/contrib/findholes/holes/holes.go b/contrib/findholes/holes/holes.go index 95c9d2b..d298efb 100644 --- a/contrib/findholes/holes/holes.go +++ b/contrib/findholes/holes/holes.go @@ -130,7 +130,7 @@ func Find(fd int) (segments []Segment, err error) { cursor = off if oldCursor == cursor { - return nil, fmt.Errorf("%s\nerror: seek loop!", PrettyPrint(segments)) + return nil, fmt.Errorf("%s\nerror: seek loop", PrettyPrint(segments)) } } return segments, nil |
