Golang — Configuration on Mac OS
Step by Step
In one of recent product developments — our new Sr. Engineer introduced Go language to be the core part of the API layer. Other than boosting his confident & motivation (fresh-new-blood guy but his voice is heard), it’s part of my playbook to promote (pressure) consistent learning in the team. You live in tech universe & if you blink longer than 1 second, you’ll be left out.
So ya, the engineer inside me scratching my skin to come out & I spent few hours to dig into Go. Quite interesting.
Steps :
Go to https://go.dev/dl/
Complete installation
Set the correct PATH by updating ~/.zshrc :
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
Terminal > run go version command
Visual Studio Code > Go extension
Type the following go scripts
Run go run hello.go command
Bonus
RESTful API — Fundamental
Create project folder
Create a new file called main.go
Run go run . command