Installing Go for first-time programmers on a Mac

  1. Download & Install Go; the programming language tools/binaries.
  2. Download & Install a Code Editor; a tool to write Go code in.
  3. Create Your Go Workspace; a place to store your code.
  4. Write Your First Go Program; a simple “hello world” program.

1. Download & Install Go

Installing Go

Verifying Go is installed

2. Download & Install a Code Editor

Overview of code editors for Go

Installing VS Code

A note about Telemetry in VS Code

"telemetry.enableTelemetry": false
"telemetry.enableCrashReporter": false

Installing the Go extension

3. Create Your Go Workspace

Toggle the checkbox next to the House icon with your username to add your Home directory to Favorites
  1. Change to the package directory,
    e.g.cd ~/go/src/github.com/ryan0x44/go-helloworld
  2. Use go run to execute the code,
    e.g. go run main.go

4. Write Your First Go Program

package mainimport "fmt"func main() {
name := "you"
fmt.Printf("Hello %s", name)
}
cd go/src/hello-you
go build
./hello-you
cd go/src/hello-you
go install
~/go/bin/hello-you

--

--

--

#DevOps, #Security, Go (#golang), #Linux, #Docker, #Kubernetes. Senior Engineering Manager @Xero. Previously: DevTools EM @Cloudflare. Opinions are my own.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Ikigai and Software Engineering Degree Program

Delio Opens BTC, ETH Savings, 12%+additional 4% annual interest

7 Principles for Engineering Team Success

kubectl prompting for username and password with EKS

Multi-Region PingFederate Cluster Discovery

Flexible Payment options, convenient payments, real-time quick transaction process and so much more…

Step-by-step guide on issuing your NEP-5 token on NEO’s Private net using Go

Observability: 3 things about it.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ryan D

Ryan D

#DevOps, #Security, Go (#golang), #Linux, #Docker, #Kubernetes. Senior Engineering Manager @Xero. Previously: DevTools EM @Cloudflare. Opinions are my own.

More from Medium

Concurrency in Go ( Beginners )

Docker buildx on Apple Silicon

Getting started with GO Programming Language — Part Two

Building a Simple REST API in Go With Gorilla/Mux