Node_Exporter/vendor/github.com/mdlayher/netlink/nlenc/endian.go
Ben Kochie 0e77317955
Update netlink vendoring (#1471)
* github.com/ema/qdisc
* github.com/mdlayher/genetlink
* github.com/mdlayher/wifi

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-09-05 15:35:13 +02:00

15 lines
301 B
Go

package nlenc
import "encoding/binary"
// NativeEndian returns the native byte order of this system.
func NativeEndian() binary.ByteOrder {
// Determine endianness by storing a uint16 in a byte slice.
b := Uint16Bytes(1)
if b[0] == 1 {
return binary.LittleEndian
}
return binary.BigEndian
}