Get Started with Go
George Rodier
November 15, 2024
The Go programming language has a ton of great tutorials to help newcomers get started and seasoned developers deepen their understanding of the languages’s features. The included video gives a walk through of their introduction “Hello World” example. If you wanted to follow along, start with the Go documentation:
The rest of this article will provide helpful resources on the commands used, the code written, and additional resources so you can dive even deeper!
Resources
- Installing Go
- Installing Go with Homebrew
go version
go mod init
- Managing Go dependencies
go get
go mod tidy
go run
go build
- Completed code in GitHub
Code
Initial hello world:
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
Using a module:
package main
import (
"fmt"
"rsc.io/quote"
)
func main() {
fmt.Println(quote.Go())
}