util/endian: add Native variable to get the platform's native binary.ByteOrder
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
883a11f2a8
commit
c8939ab7c7
@@ -6,5 +6,10 @@
|
|||||||
|
|
||||||
package endian
|
package endian
|
||||||
|
|
||||||
|
import "encoding/binary"
|
||||||
|
|
||||||
// Big is whether the current platform is big endian.
|
// Big is whether the current platform is big endian.
|
||||||
const Big = true
|
const Big = true
|
||||||
|
|
||||||
|
// Native is the platform's native byte order.
|
||||||
|
var Native = binary.BigEndian
|
||||||
|
|||||||
@@ -6,5 +6,10 @@
|
|||||||
|
|
||||||
package endian
|
package endian
|
||||||
|
|
||||||
|
import "encoding/binary"
|
||||||
|
|
||||||
// Big is whether the current platform is big endian.
|
// Big is whether the current platform is big endian.
|
||||||
const Big = false
|
const Big = false
|
||||||
|
|
||||||
|
// Native is the platform's native byte order.
|
||||||
|
var Native = binary.LittleEndian
|
||||||
|
|||||||
Reference in New Issue
Block a user