Master Go language | Go language tutorial | Go Lang tutorial - 5

Опубликовано: 03 Июль 2026
на канале: tech tonic
19
2

#go #golang #golangtutorial


1. Create Simple Go Program
2. Run Go Program
go run fileName.go
go run -x fileName.go
3. Build executable fileName
go build fileName.go
go build -o myApp.exe
3. 1. Build executable windows
GOOS=windows GOARCH=amd64 go build -o windowsApp.exe
3.2. Build executable Linux
GOOS=linux GOARCH=amd64 go build -o linuxApp.sh
3.3. Build executable Mac
GOOS=darwin GOARCH=amd64 go build -o macApp
4. Go Install also used to generate executable
But go install will place the executables under bin folder
go build place the executable in current working folder
While using go install you shold use paths to relative to GOPATH/src