Overview
Go only supports four types of constant
- Numeric ( int, int64, float, float64, complex128 etc)
- String
- Character or rune
- Boolean
Go doesn’t support const map. So below program would raise a compilation error
Example
package main
func main() {
const e = map[string]int{
"a": 1,
}
}
Output
const initializer map[string]int literal is not a constant