How to Declare Constants in Go with const

Declare immutable values in Go using the const keyword with a name and a compile-time value.

Use the const keyword followed by the name and value to declare a constant that cannot be changed at runtime.

const MaxRetries = 3
const Pi = 3.14159
const (
	True  = true
	False = false
)

Constants are evaluated at compile time, must be of a basic type (like int, string, or bool), and are scoped to the package where they are defined.