Skip to content

Commit e4f7c64

Browse files
committed
fix lint and unit tests
1 parent 658dee2 commit e4f7c64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

client/object_id_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"crypto/md5"
1010
"crypto/rand"
1111
"encoding/binary"
12+
"encoding/hex"
1213
"fmt"
1314
"io"
1415
"os"
@@ -43,7 +44,9 @@ func readMachineId() []byte {
4344
return id
4445
}
4546
hw := md5.New()
46-
hw.Write([]byte(hostname))
47+
if _, err := hw.Write([]byte(hostname)); err != nil {
48+
panic(err)
49+
}
4750
copy(id, hw.Sum(nil))
4851
return id
4952
}
@@ -64,5 +67,5 @@ func newObjectID() string {
6467
b[9] = byte(i >> 16)
6568
b[10] = byte(i >> 8)
6669
b[11] = byte(i)
67-
return string(b[:])
70+
return hex.EncodeToString(b[:])
6871
}

0 commit comments

Comments
 (0)