Hello World Program
-
go mod init test will create go module = test
$ mkdir test
$ cd test
$ go mod init test //This will create a go.mod file
$ cat go.mod
module test
go 1.24.0
-
Create main.go
// main.go
package main
import "fmt"
func main() {
fmt.Println("Hi")
}
$ go run main.go
Hi