Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// hello.go — a minimal Go program package main import ( "fmt" "runtime" ) func main() { // Print a greeting fmt.Println("Hello, Go!") // Show some runtime information fmt.Printf("Go version : %s ", runtime.Version()) fmt.Printf("OS : %s ", runtime.GOOS) fmt.Printf("Architecture: %s ", runtime.GOARCH) fmt.Printf("CPUs : %d ", runtime.NumCPU()) // Demonstrate basic variable declaration language := "Go" year := 2009 fmt.Printf("%s was first released in %d. ", language, year) // A simple loop for i := 1; i <= 3; i++ { fmt.Printf("Iteration %d ", i) } }
Result
Open