We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go 1.21
go env
GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/arthurwang/Library/Caches/go-build' GOENV='/Users/arthurwang/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/arthurwang/go/pkg/mod' GOOS='darwin' GOPATH='/Users/arthurwang/go' GOPROXY='https://proxy.golang.org,direct' GOROOT='/opt/homebrew/Cellar/go/1.21.1/libexec' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/opt/homebrew/Cellar/go/1.21.1/libexec/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.21.1' GCCGO='gccgo' AR='ar' CC='cc' CXX='c++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/fd/79_ybcj55_1__0nhtlyrrvc40000gn/T/go-build590198146=/tmp/go-build -gno-record-gcc-switches -fno-common'
I was trying setting variables with ldflags in gomobile
here's my file structure and code └── sdk ├── go.mod └── sdk.go
go.mod
module github.com/MyRepo/sdk go 1.21.1
sdk.go
package sdk var ( SDKVersion string ) func Print() { fmt.Println("######") fmt.Println(SDKVersion) fmt.Println("######") }
and here's my command I've tried both
gomobile bind -v -target=ios -ldflags "-s -w -X sdk.SDKVersion=testVersion"
and gomobile bind -v -target=ios -ldflags "-s -w -X github.com/MyRepo/sdk/sdk.SDKVersion=testVersion"
Here's my output
###### ######
###### testVersion ######
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Go version
go 1.21
Output of
go env
in your module/workspace:What did you do?
I was trying setting variables with ldflags in gomobile
here's my file structure and code
└── sdk
├── go.mod
└── sdk.go
go.mod
sdk.go
and here's my command
I've tried both
gomobile bind -v -target=ios -ldflags "-s -w -X sdk.SDKVersion=testVersion"
and
gomobile bind -v -target=ios -ldflags "-s -w -X github.com/MyRepo/sdk/sdk.SDKVersion=testVersion"
What did you see happen?
Here's my output
What did you expect to see?
The text was updated successfully, but these errors were encountered: