diff options
| author | Chris Lu <chris.lu@gmail.com> | 2016-04-09 01:16:13 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2016-04-09 01:16:13 -0700 |
| commit | 3523ad523929870aa8d4a7741ee8e152cfd40489 (patch) | |
| tree | cfc771c2b9705fc8eab34a1ec1232d3af22cda0f /go/operation/sync_volume.go | |
| parent | 5d100994b1b9c6679113c8dd73f97aff85397f02 (diff) | |
| parent | 18254d9aaef18f6b836a710e7726711da9aef543 (diff) | |
| download | seaweedfs-3523ad523929870aa8d4a7741ee8e152cfd40489.tar.xz seaweedfs-3523ad523929870aa8d4a7741ee8e152cfd40489.zip | |
Merge pull request #284 from thinxer/binary
replace util/bytes.go with binary.BigEndian (again)
Diffstat (limited to 'go/operation/sync_volume.go')
| -rw-r--r-- | go/operation/sync_volume.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/go/operation/sync_volume.go b/go/operation/sync_volume.go index 54944a64e..626b2a7ba 100644 --- a/go/operation/sync_volume.go +++ b/go/operation/sync_volume.go @@ -1,6 +1,7 @@ package operation import ( + "encoding/binary" "encoding/json" "fmt" "net/url" @@ -42,9 +43,9 @@ func GetVolumeIdxEntries(server string, vid string, eachEntryFn func(key uint64, values.Add("volume", vid) line := make([]byte, 16) err := util.GetBufferStream("http://"+server+"/admin/sync/index", values, line, func(bytes []byte) { - key := util.BytesToUint64(bytes[:8]) - offset := util.BytesToUint32(bytes[8:12]) - size := util.BytesToUint32(bytes[12:16]) + key := binary.BigEndian.Uint64(bytes[:8]) + offset := binary.BigEndian.Uint32(bytes[8:12]) + size := binary.BigEndian.Uint32(bytes[12:16]) eachEntryFn(key, offset, size) }) if err != nil { |
