package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
You can create a Go source code file with a .go
extension, paste this code into it, and then run the program. Make sure you have Go installed on your system. To run the program, open your terminal or command prompt, navigate to the directory where your Go source code file is located, and then use the go run
command:
go run filename.go