chore: fix megacheck

This commit is contained in:
Nao YONASHIRO 2019-06-05 03:48:59 +09:00 committed by Nao YONASHIRO
parent d9d865c74a
commit 38fa3608ce
1 changed files with 4 additions and 3 deletions

View File

@ -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)
@ -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
}
}