xxxxxxxxxx
// single constant
const (
A = "A"
B = "B"
)
// multiple constant
const (
A, B = "A", "B"
Monday, Sunday = "Monday", "Sunday"
)
xxxxxxxxxx
Constants are declared like variables, but with the const keyword.
Constants can be character, string, boolean, or numeric values.
Constants cannot be declared using the := syntax.
xxxxxxxxxx
const lightSpeed = 299792458 // initial value
// Error! Constants cannot be changed
lightSpeed = 299792460