Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.17.6 darwin/arm64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/Users/andig/Library/Caches/go-build" GOENV="/Users/andig/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/andig/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/andig/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/opt/homebrew/Cellar/go/1.17.6/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/opt/homebrew/Cellar/go/1.17.6/libexec/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.17.6" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build3031970245=/tmp/go-build -gno-record-gcc-switches -fno-common" GOROOT/bin/go version: go version go1.17.6 darwin/arm64 GOROOT/bin/go tool compile -V: compile version go1.17.6 uname -v: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 ProductName: macOS ProductVersion: 12.2 BuildVersion: 21D49 lldb --version: lldb-1300.0.42.3 Swift version 5.5.2-dev
What did you do?
Use goreleaser to create multi-platform release. Amongst others, goreleaser executes:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -race main.go
What did you expect to see?
Sucess
What did you see instead?
go build: -race requires cgo
I would like to request documenting the cgo requirements per platform as part of https://go.dev/doc/articles/race_detector.