util/endian: delete package; use updated josharian/native instead
See josharian/native#3 Updates golang/go#57237 Change-Id: I238c04c6654e5b9e7d9cfb81a7bbc5e1043a84a2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
bd2995c14b
commit
ca08e316af
@@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"tailscale.com/util/endian"
|
||||
"github.com/josharian/native"
|
||||
)
|
||||
|
||||
// Size of a pointer-typed value, in bits
|
||||
@@ -121,7 +121,7 @@ func (d *Decoder) Uint16() uint16 {
|
||||
d.err = err
|
||||
return 0
|
||||
}
|
||||
return endian.Native.Uint16(d.dbuf[0:2])
|
||||
return native.Endian.Uint16(d.dbuf[0:2])
|
||||
}
|
||||
|
||||
// Uint32 returns a uint32 decoded from the buffer.
|
||||
@@ -134,7 +134,7 @@ func (d *Decoder) Uint32() uint32 {
|
||||
d.err = err
|
||||
return 0
|
||||
}
|
||||
return endian.Native.Uint32(d.dbuf[0:4])
|
||||
return native.Endian.Uint32(d.dbuf[0:4])
|
||||
}
|
||||
|
||||
// Uint64 returns a uint64 decoded from the buffer.
|
||||
@@ -147,7 +147,7 @@ func (d *Decoder) Uint64() uint64 {
|
||||
d.err = err
|
||||
return 0
|
||||
}
|
||||
return endian.Native.Uint64(d.dbuf[0:8])
|
||||
return native.Endian.Uint64(d.dbuf[0:8])
|
||||
}
|
||||
|
||||
// Uintptr returns a uintptr decoded from the buffer.
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build mips || mips64 || ppc64 || s390x
|
||||
|
||||
package endian
|
||||
|
||||
import "encoding/binary"
|
||||
|
||||
// Big is whether the current platform is big endian.
|
||||
const Big = true
|
||||
|
||||
// Native is the platform's native byte order.
|
||||
var Native = binary.BigEndian
|
||||
@@ -1,6 +0,0 @@
|
||||
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package endian exports a constant about whether the machine is big endian.
|
||||
package endian
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build 386 || amd64 || arm || arm64 || mips64le || mipsle || ppc64le || riscv64 || wasm || loong64
|
||||
|
||||
package endian
|
||||
|
||||
import "encoding/binary"
|
||||
|
||||
// Big is whether the current platform is big endian.
|
||||
const Big = false
|
||||
|
||||
// Native is the platform's native byte order.
|
||||
var Native = binary.LittleEndian
|
||||
Reference in New Issue
Block a user