Type system

Go pointer types

Holds a pointer to a variable of type T or nil. Dereferencing a nil pointer panics; ordinary Go has no pointer arithmetic. Example output: '8'.

Formal Syntax & Structure

go syntaxgo
*T

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  n := 5  p := &n  *p = 8  fmt.Println(n)}
Go Reference