Basic Syntax in Go
From the Go cheat sheet ยท Setup & Basics ยท verified Jul 2026
Basic Syntax
Go program structure and syntax
go
package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}
// Variables
var name string = "Go"
age := 25 // Short declaration๐ Static typing with type inference
๐ฏ Simple, clean syntax without semicolons
๐ง := for short variable declarations
๐ฆ Package-based organization