Go Reference

Quick reference guide for Go (Golang) with syntax examples and best practices

Basics

Hello World

Basic Go program structure

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

Variables & Constants

Variable and constant declaration

// Variable declaration
var name string = "John"
age := 25 // Short declaration

// Constants
const Pi = 3.14159
const MaxRetries = 5

Type Conversion

Type conversion in Go

// Convert between types
var x int = 42
var f float64 = float64(x)
var i int = int(f)

// String conversion
str := strconv.Itoa(42)
num, err := strconv.Atoi("42")

Looking for more developer tools? Check out aimentionfinder.com for additional productivity resources.