DEV Community

Cover image for Variables
Vlad .
Vlad .

Posted on

Variables

Today I’ve learned all of variables in Golang:

var a int8 = -11
//
1byte

var b int16 = 32000
2bytes

var c int32 = 1000000000
4bytes

var d int64 = 100000000000000
// 8bytes

var e uint8 = 11
// same as int but cannot be negative

var f byte = 250
// same as uint8

var g rune = -2567876
// same as
int32

var k int = 765
// int32 or int64

var l uint = 765
// uint32 or uint64

var m float32 = 3.987
// 4 bytes

var n float64 = 3. 98779786879
// 8 bytes

var isOne = true

var onWay = false

var name = "i "

fh := "assign everything"

const eu float64 = 15.9777575 // cannot change it

Top comments (0)