fix golint failures of pkg/kubelet/checkpointmanager/checksum

This commit is contained in:
SataQiu
2019-04-25 09:56:43 +08:00
parent 20b76a2b4a
commit bf37c8a217
2 changed files with 3 additions and 3 deletions

View File

@@ -23,10 +23,10 @@ import (
hashutil "k8s.io/kubernetes/pkg/util/hash"
)
// Data to be stored as checkpoint
// Checksum is the data to be stored as checkpoint
type Checksum uint64
// VerifyChecksum verifies that passed checksum is same as calculated checksum
// Verify verifies that passed checksum is same as calculated checksum
func (cs Checksum) Verify(data interface{}) error {
if cs != New(data) {
return errors.ErrCorruptCheckpoint
@@ -34,6 +34,7 @@ func (cs Checksum) Verify(data interface{}) error {
return nil
}
// New returns the Checksum of checkpoint data
func New(data interface{}) Checksum {
return Checksum(getChecksum(data))
}