Skip to content

Commit

Permalink
chore: fix megacheck
Browse files Browse the repository at this point in the history
  • Loading branch information
orisano committed Jun 4, 2019
1 parent ace76f4 commit a93b5a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func ConfigureLogging(logLevel string) error {
func Hasher() func(string) (string, error) {
pool := sync.Pool{
New: func() interface{} {
return make([]byte, highwayhash.Size*10*1024)
b := make([]byte, highwayhash.Size*10*1024)
return &b
},
}
key := make([]byte, highwayhash.Size)
Expand All @@ -71,9 +72,9 @@ func Hasher() func(string) (string, error) {
return "", err
}
defer f.Close()
buf := pool.Get().([]byte)
buf := pool.Get().(*[]byte)
defer pool.Put(buf)
if _, err := io.CopyBuffer(h, f, buf); err != nil {
if _, err := io.CopyBuffer(h, f, *buf); err != nil {
return "", err
}
}
Expand Down

0 comments on commit a93b5a3

Please sign in to comment.