Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930
  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.
  4. package cpu
  5. import (
  6. "encoding/binary"
  7. "runtime"
  8. )
  9. // hostByteOrder returns binary.LittleEndian on little-endian machines and
  10. // binary.BigEndian on big-endian machines.
  11. func hostByteOrder() binary.ByteOrder {
  12. switch runtime.GOARCH {
  13. case "386", "amd64", "amd64p32",
  14. "arm", "arm64",
  15. "mipsle", "mips64le", "mips64p32le",
  16. "ppc64le",
  17. "riscv", "riscv64":
  18. return binary.LittleEndian
  19. case "armbe", "arm64be",
  20. "mips", "mips64", "mips64p32",
  21. "ppc", "ppc64",
  22. "s390", "s390x",
  23. "sparc", "sparc64":
  24. return binary.BigEndian
  25. }
  26. panic("unknown architecture")
  27. }