Basic Types
int, int64, uint8, float64, string, bool, byte and rune. int is the default integer.
Example
package main
import "fmt"
func main() {
var i int = 7
var f float64 = 2.5
var s string = "Go"
var b bool = true
var r rune = 'A'
fmt.Println(i, f, s, b, r)
}Result
7 2.5 Go true 65
Exercise
Decimal type.
var f = 2.5
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.