fix golint failures of pkg/kubelet/checkpointmanager/checksum

k3s-v1.15.3
SataQiu 2019-04-25 09:56:43 +08:00
parent 20b76a2b4a
commit bf37c8a217
2 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,6 @@ pkg/kubelet/apis/config/v1beta1
pkg/kubelet/apis/deviceplugin/v1beta1
pkg/kubelet/cadvisor
pkg/kubelet/cadvisor/testing
pkg/kubelet/checkpointmanager/checksum
pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1
pkg/kubelet/client
pkg/kubelet/cm

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))
}