The classic first program.
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Explanation:
package main
declares this file as part of the main package, the entry point of the application.import "fmt"
imports thefmt
package, providing formatting and printing functions.func main()
defines the main function where the program execution begins.fmt.Println
prints the given string to standard output.