Remove bytesToUint64 from agent/consul

This commit is contained in:
Daniel Nephin 2020-06-18 12:39:11 -04:00
parent a00f007c5e
commit b0ba546a1f
2 changed files with 0 additions and 23 deletions

View File

@ -1,8 +1,6 @@
package consul package consul
import ( import (
"encoding/binary"
"fmt"
"runtime" "runtime"
"strconv" "strconv"
@ -50,18 +48,6 @@ func isConsulNode(m serf.Member) (bool, string) {
return true, m.Tags["dc"] return true, m.Tags["dc"]
} }
// Converts bytes to an integer
func bytesToUint64(b []byte) uint64 {
return binary.BigEndian.Uint64(b)
}
// Converts a uint to a byte slice
func uint64ToBytes(u uint64) []byte {
buf := make([]byte, 8)
binary.BigEndian.PutUint64(buf, u)
return buf
}
// runtimeStats is used to return various runtime information // runtimeStats is used to return various runtime information
func runtimeStats() map[string]string { func runtimeStats() map[string]string {
return map[string]string{ return map[string]string{

View File

@ -125,15 +125,6 @@ func TestIsConsulNode(t *testing.T) {
} }
} }
func TestByteConversion(t *testing.T) {
t.Parallel()
var val uint64 = 2 << 50
raw := uint64ToBytes(val)
if bytesToUint64(raw) != val {
t.Fatalf("no match")
}
}
func TestGenerateUUID(t *testing.T) { func TestGenerateUUID(t *testing.T) {
t.Parallel() t.Parallel()
prev := generateUUID() prev := generateUUID()