From e4f7c64c5ad5c15f1a7dcd74cd593886799c0f0d Mon Sep 17 00:00:00 2001 From: Mike Gray Date: Thu, 11 Apr 2019 13:51:55 -0400 Subject: [PATCH] fix lint and unit tests --- client/object_id_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/object_id_test.go b/client/object_id_test.go index 728c8a4..84e0967 100644 --- a/client/object_id_test.go +++ b/client/object_id_test.go @@ -9,6 +9,7 @@ import ( "crypto/md5" "crypto/rand" "encoding/binary" + "encoding/hex" "fmt" "io" "os" @@ -43,7 +44,9 @@ func readMachineId() []byte { return id } hw := md5.New() - hw.Write([]byte(hostname)) + if _, err := hw.Write([]byte(hostname)); err != nil { + panic(err) + } copy(id, hw.Sum(nil)) return id } @@ -64,5 +67,5 @@ func newObjectID() string { b[9] = byte(i >> 16) b[10] = byte(i >> 8) b[11] = byte(i) - return string(b[:]) + return hex.EncodeToString(b[:]) }