2 回答
TA贡献1893条经验 获得超10个赞
使用 GOARCH for arm:arm (ARM) 和 arm64 (AArch64),
可选的环境变量
$GOOS 和 $GOARCH
目标操作系统和编译架构的名称。它们分别默认为 $GOHOSTOS 和 $GOHOSTARCH 的值(如下所述)。
$GOOS 的选择是
$GOOS $GOARCH
darwin 386
darwin amd64
darwin arm
darwin arm64
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
linux 386
linux amd64
linux arm
linux arm64
linux ppc64
linux ppc64le
linux mips64
linux mips64le
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
openbsd arm
plan9 386
plan9 amd64
solaris amd64
windows 386
windows amd64
TA贡献1869条经验 获得超4个赞
const is64Bit = uint64(^uintptr(0)) == ^uint64(0)
这是有效的,因为 ifuintptr是 32 位,^uintptr(0)将是0xffffffff而不是0xffffffffffffffff.
^uint64(0)0xffffffffffffffff无论是 32 位还是 64 位架构,都将始终如此。
- 2 回答
- 0 关注
- 489 浏览
添加回答
举报
