Predeclared type

Go int type

Signed integer with implementation-dependent width of 32 or 64 bits. Typical choice for lengths and indices; not a fixed-width wire format. Example output: '42'.

Formal Syntax & Structure

go syntaxgo
int

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  var count int = 42  fmt.Println(count)}
Go Reference