-
Notifications
You must be signed in to change notification settings - Fork 0
/
others_go1.19.go
30 lines (25 loc) · 1.08 KB
/
others_go1.19.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Code generated by generate_go1.19.go; DO NOT EDIT.
//go:build go1.19 && !386 && !amd64 && !amd64p32 && !arm && !arm64 && !arm64be && !armbe && !loong64 && !mips && !mips64 && !mips64le && !mips64p32 && !mips64p32le && !mipsle && !ppc && !ppc64 && !ppc64le && !riscv && !riscv64 && !s390 && !s390x && !sparc && !sparc64 && !wasm && !generate
// +build go1.19,!386,!amd64,!amd64p32,!arm,!arm64,!arm64be,!armbe,!loong64,!mips,!mips64,!mips64le,!mips64p32,!mips64p32le,!mipsle,!ppc,!ppc64,!ppc64le,!riscv,!riscv64,!s390,!s390x,!sparc,!sparc64,!wasm,!generate
package endian
import (
"encoding/binary"
"unsafe"
)
// Native is the byte order of GOARCH.
// It will be determined at runtime because it was unknown at code
// generation time.
var Native interface {
binary.ByteOrder
binary.AppendByteOrder
}
func init() {
// http://grokbase.com/t/gg/golang-nuts/129jhmdb3d/go-nuts-how-to-tell-endian-ness-of-machine#20120918nttlyywfpl7ughnsys6pm4pgpe
var x int32 = 0x01020304
switch *(*byte)(unsafe.Pointer(&x)) {
case 1:
Native = binary.BigEndian
case 4:
Native = binary.LittleEndian
}
}