@@ -64,12 +64,11 @@ func checksum(path string) (string, error) {
|
|||||||
buf := make([]byte, 64*1024)
|
buf := make([]byte, 64*1024)
|
||||||
sha256 := sha256.New()
|
sha256 := sha256.New()
|
||||||
fd, err := os.Open(path)
|
fd, err := os.Open(path)
|
||||||
defer fd.Close()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("Unable to checksum: ", path)
|
log.Print("Unable to checksum: ", path)
|
||||||
return sum, err
|
return sum, err
|
||||||
}
|
}
|
||||||
|
defer fd.Close()
|
||||||
|
|
||||||
// Read file in chunks
|
// Read file in chunks
|
||||||
for {
|
for {
|
||||||
|
Reference in New Issue
Block a user