diff --git a/util/endian/big.go b/util/endian/big.go new file mode 100644 index 000000000..0dcdbab1f --- /dev/null +++ b/util/endian/big.go @@ -0,0 +1,10 @@ +// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build mips mips64 ppc64 s390x + +package endian + +// Big is whether the current platform is big endian. +const Big = true diff --git a/util/endian/endian.go b/util/endian/endian.go new file mode 100644 index 000000000..863ab638e --- /dev/null +++ b/util/endian/endian.go @@ -0,0 +1,6 @@ +// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package endian exports a constant about whether the machine is big endian. +package endian diff --git a/util/endian/little.go b/util/endian/little.go new file mode 100644 index 000000000..dd8686356 --- /dev/null +++ b/util/endian/little.go @@ -0,0 +1,10 @@ +// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 arm arm64 mips64le mipsle ppc64le riscv64 wasm + +package endian + +// Big is whether the current platform is big endian. +const Big = false