Getting Started with Go: First Program and Basic Practices

This article covers the four most fundamental steps in learning Go: writing your first program, creating a utility library, writing unit tests, and using remote packages. The content follows the original GOPATH workflow from the early Go 1.x era. Note: Go Modules were introduced in Go 1.11 and became the default in Go 1.16, effectively replacing GOPATH mode. For new projects, use go mod init to create a module instead of manually setting up GOPATH. The examples below preserve the original style for reference. ...

February 10, 2015 · 3 min · haoxiqiang