A first project
Notes// archive From the original Code Walker docs. Kept for reference, so some versions and commands may be out of date.
mkdir ~/Golang/projects/hello && cd ~/Golang/projects/helloCreate Module#
A Go module or module path as a canonical name or identifier for your project and need to be unique.
For example initialize a module:
go mod init hello.example.comWhich creates a file go.mod:
module hello.example.com
go 1.22.4Hello World#
Create the following main.go file:
main.gogo
package main
import "fmt"
func main() {
fmt.Println("Hello world!")
}Run the program:
go run .