diff options
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/atomicrename/main.go | 7 | ||||
| -rw-r--r-- | contrib/findholes/holes/holes.go | 4 | ||||
| -rwxr-xr-x | contrib/gocryptfs-maybe.bash | 2 | ||||
| -rwxr-xr-x | contrib/maxlen.bash | 2 |
4 files changed, 6 insertions, 9 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..72f5114 100644 --- a/contrib/findholes/holes/holes.go +++ b/contrib/findholes/holes/holes.go @@ -8,7 +8,6 @@ import ( "math/rand" "os" "syscall" - "time" ) const ( @@ -130,7 +129,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 @@ -176,7 +175,6 @@ func Create(path string) { } defer f.Close() - rand.Seed(time.Now().UnixNano()) offsets := make([]int64, 10) for i := range offsets { offsets[i] = int64(rand.Int31n(60000)) diff --git a/contrib/gocryptfs-maybe.bash b/contrib/gocryptfs-maybe.bash index daf3e60..d83dd91 100755 --- a/contrib/gocryptfs-maybe.bash +++ b/contrib/gocryptfs-maybe.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Conditionally try to mount a gocryptfs filesystem. If either # * CIPHERDIR/gocryptfs.conf does not exist OR diff --git a/contrib/maxlen.bash b/contrib/maxlen.bash index be5f7a6..4cf5802 100755 --- a/contrib/maxlen.bash +++ b/contrib/maxlen.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Find out the maximum supported filename length and print it. # |
