Open george012 opened 3 months ago
You should be able to use GOFLAGS for this purpose I think.
Confirmed, it took me a little while to figure it out, but I got the following working:
GOFLAGS="--ldflags=-X=main.version=v0.0.0" fyne-cross darwin -app-id=test.test
The main catch was whitespaces in the GOFLAG
variable.
See this very informative thread.
I think adding an example in the README would be worth it :)
Customize
-ldflags
For example,fyne-cross darwin -arch=arm64,amd64 -app-id com.test.test -ldflags="-X main.GoVersion=1.21.1"
, this usage, I need this in my App development.The native compilation method of golang is
go build -o build_path/build_name -trimpath -ldflags "-X main.GoVersion=1.21.1" main.go
There are many custom parameters for custom
-X ...