1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 // hostByteOrder returns binary.LittleEndian on little-endian machines and
13 // binary.BigEndian on big-endian machines.
14 func hostByteOrder() binary.ByteOrder {
15 switch runtime.GOARCH {
16 case "386", "amd64", "amd64p32",
18 "mipsle", "mips64le", "mips64p32le",
21 return binary.LittleEndian
22 case "armbe", "arm64be",
23 "mips", "mips64", "mips64p32",
27 return binary.BigEndian
29 panic("unknown architecture")