Add strict checks with vet, golint and gofmt

This commit is contained in:
Harshavardhana
2015-03-09 16:15:06 -07:00
parent d02fb75dfd
commit b952855779
6 changed files with 25 additions and 17 deletions

View File

@@ -107,11 +107,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
}
// Calculate sha512
func (d0 *digest) Sum(in []byte) []byte {
func (d *digest) Sum(in []byte) []byte {
// Make a copy of d0 so that caller can keep writing and summing.
d := new(digest)
*d = *d0
hash := d.checkSum()
d0 := *d
hash := d0.checkSum()
return append(in, hash[:]...)
}