diff options
| author | Jianfei Wang <wjf@megvii.com> | 2016-04-06 17:03:32 +0800 |
|---|---|---|
| committer | Jianfei Wang <wjf@megvii.com> | 2016-04-06 17:08:52 +0800 |
| commit | 7bc10d46e333496b7de1d6e774b3e88b5a7d8ab8 (patch) | |
| tree | 84e82e18d98ed25a6863c0aafedd1fb19bf8701d /go/storage/file_id.go | |
| parent | 6876bfa68524d4fc0a961f89dc29e53fbc654ea5 (diff) | |
| download | seaweedfs-7bc10d46e333496b7de1d6e774b3e88b5a7d8ab8.tar.xz seaweedfs-7bc10d46e333496b7de1d6e774b3e88b5a7d8ab8.zip | |
replace util/bytes.go with binary.BigEndian
Diffstat (limited to 'go/storage/file_id.go')
| -rw-r--r-- | go/storage/file_id.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/go/storage/file_id.go b/go/storage/file_id.go index 64b61ba89..3d2944403 100644 --- a/go/storage/file_id.go +++ b/go/storage/file_id.go @@ -1,12 +1,12 @@ package storage import ( + "encoding/binary" "encoding/hex" "errors" "strings" "github.com/chrislusf/seaweedfs/go/glog" - "github.com/chrislusf/seaweedfs/go/util" ) type FileId struct { @@ -34,8 +34,8 @@ func ParseFileId(fid string) (*FileId, error) { } func (n *FileId) String() string { bytes := make([]byte, 12) - util.Uint64toBytes(bytes[0:8], n.Key) - util.Uint32toBytes(bytes[8:12], n.Hashcode) + binary.BigEndian.PutUint64(bytes[0:8], n.Key) + binary.BigEndian.PutUint32(bytes[8:12], n.Hashcode) nonzero_index := 0 for ; bytes[nonzero_index] == 0; nonzero_index++ { } |
