Constants are declared like variables, but with the `const` keyword. Constants can be character, string, boolean, or numeric values. They cannot be declared using the `:=` syntax.
Defining configuration values, math constants (Pi), or enums.
Using untyped and typed constants.
const Pi = 3.14
const (
StatusOk = 200
StatusNotFound = 404
)
func main() {
const World = "世界"
fmt.Println("Hello", World)
fmt.Println("Pi:", Pi)
}
Use `iota` for creating enumerated constants (enums).