mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Add strict checks with vet, golint and gofmt
This commit is contained in:
@@ -100,10 +100,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
}
|
||||
|
||||
// Return checksum bytes
|
||||
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 := *d0
|
||||
hash := d.checkSum()
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
return append(in, hash[:]...)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,5 +17,3 @@ func blockAVX2(dig *digest, p []byte) {
|
||||
func blockSSE3(dig *digest, p []byte) {
|
||||
C.sha1_update_intel((*C.int32_t)(unsafe.Pointer(&dig.h[0])), (*C.char)(unsafe.Pointer(&p[0])), (C.size_t)(len(p)/chunk))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ func (d *digest) Write(p []byte) (nn int, err error) {
|
||||
}
|
||||
|
||||
// Return sha256 sum in bytes
|
||||
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 := *d0
|
||||
hash := d.checkSum()
|
||||
d0 := *d
|
||||
hash := d0.checkSum()
|
||||
return append(in, hash[:]...)
|
||||
}
|
||||
|
||||
|
||||
@@ -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[:]...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user