How many bits will be assigned to a const int?

Viewed 15

I am creating constants this way:

const (
    Separator_None = 0
    Separator_Dot  = 1
    Separator_Dash = 2
)

Will Golang create the constants as 8-bit integers or the default int 32/64?


If I want 8-bit integers, do I have to define it this way? I.e. Go won't figure it out on its own and do it for me?

Separator_None int8 = 0
Separator_Dot       = 1
Separator_Dash      = 2
0 Answers
Related