5. Go - Build and Run
go build gofile.go
// builts a executable
go run gofile.go
// runs go code
go build -ldflags "-X main.variable=value -H=windowsgui"
// -X : changes a variable in the code
// main.variable = value
go build -ldflags "-H=windowsgui"
// hides CMD prompt when building/running app
go build -ldflags "-H=windowsgui -s -w"
// hide CMD prompt and shrinks exe file size
go build -ldflags "-X main.variable=value -Xmain.variable2=value2"
// change two variables
Comments
Post a Comment