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

Popular posts from this blog

2. FreeCodeCamp - Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges

20. Data Analytics - Analyze Data to Answer Questions - Week 1

3. Algorithms - Selection Sort