Skip to content

Commit

Permalink
fix lint and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegray committed Apr 11, 2019
1 parent 658dee2 commit e4f7c64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/object_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"crypto/md5"
"crypto/rand"
"encoding/binary"
"encoding/hex"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -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
}
Expand All @@ -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[:])
}

0 comments on commit e4f7c64

Please sign in to comment.