Here’s a simple “Hello, World!” program in Go:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
To run this program, save it to a file with a .go
extension (e.g. hello.go
) and execute the following command in your terminal:
$ go run hello.go
You should see the output:
Hello, World!