Constants can be confusing and easy to misuse in Go if you are coming from an untyped language. In this article we will learn what constants are, and when it is best to make use of them.
Most of the points I make here apply to general-purpose programming languages as a whole, but by focusing specifically on Go we can dive a bit deeper and come up with some good rules of thumb.
Go > Javascript
Many languages have constants, typically denoted by the keyword const.
In go and javascript alike they are declared as such:
const frameRate = 60
The interesting thing about constants in Go is that they:
#cryptography #compile #constant #global #go #golang #javascript #const