Run govet and fix

This commit is contained in:
Harshavardhana
2015-02-18 15:33:19 -08:00
parent 1b1371ffec
commit fab954f13f
12 changed files with 19 additions and 27 deletions

View File

@@ -14,22 +14,20 @@
* limitations under the License.
*/
// +build amd64
package crc32c
import (
"errors"
"hash/crc32"
"hash/crc32"
)
var castanagoliTable = crc32.MakeTable(crc32.Castagnoli)
func Crc32c(buffer []byte) (uint32, error) {
crc := crc32.New(castanagoliTable)
if len(buffer) <= 0 {
return 0, errors.New("input buffer cannot be null")
}
crc.Write(buffer)
crc := crc32.New(castanagoliTable)
if len(buffer) <= 0 {
return 0, errors.New("input buffer cannot be null")
}
crc.Write(buffer)
return crc.Sum32(), nil
}

View File

@@ -14,8 +14,6 @@
* limitations under the License.
*/
// +build amd64
package crc32c
// #include <stdint.h>