Primitives#
Type |
Notes |
|---|---|
|
|
|
signed integers. |
|
unsigned integers. |
|
integer wide enough to hold a pointer; rarely needed. |
|
alias for |
|
alias for |
|
IEEE 754. |
|
complex numbers; rare outside numerical code. |
|
immutable UTF-8 byte sequence. |
Variable declarations with explicit primitive types.
var n int = 42
var b byte = 0xff
var r rune = 'A'
var f float64 = 3.14
var s string = "operator"
References#
Strings for the byte vs rune distinction in depth.
Conversion for crossing between numeric types.