我在M1版本的MacBook Air上運(yùn)行go test
束昵,會(huì)遇到錯(cuò)誤婶肩。
一般會(huì)輸出類(lèi)似如下的錯(cuò)誤提示:
gcc_arm64.S:63:16: error: brackets expression not supported on this target
ldp x23, x24, [sp, #48]
^
gcc_arm64.S:66:16: error: brackets expression not supported on this target
ldp x21, x22, [sp, #64]
^
gcc_arm64.S:69:16: error: brackets expression not supported on this target
ldp x19, x20, [sp, #80]
^
這個(gè)需要禁用CGO互站,比如
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go test -bench=.
即可正常。