Skip to content

Commit

Permalink
file checksum: reset hash before checksumming a file
Browse files Browse the repository at this point in the history
Because before downloading the file we checksum it to see if it matches
in order to skip the download.
  • Loading branch information
azr committed Feb 7, 2019
1 parent c2d455e commit dd24b91
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (c *fileChecksum) checksum(source string) error {
}
defer f.Close()

c.Hash.Reset()
if _, err := io.Copy(c.Hash, f); err != nil {
return fmt.Errorf("Failed to hash: %s", err)
}
Expand Down

0 comments on commit dd24b91

Please sign in to comment.