Detect byte order library (BigEndian or LittleEndian)
package main
import (
"fmt"
"github.com/wmentor/endian"
)
func main() {
order := endian.GetOrder()
if order == endian.BigEndian {
fmt.Println("Big Endian")
} else {
fmt.Println("Little Endian")
}
}
Insted of endian.BigEndian you can use endian.LittleEndian constant.