{"id":4127,"date":"2020-09-30T22:01:28","date_gmt":"2020-09-30T16:31:28","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=4127"},"modified":"2020-09-30T22:01:38","modified_gmt":"2020-09-30T16:31:38","slug":"declaring-constant-go","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/declaring-constant-go\/","title":{"rendered":"Declaring a constant in Go (Golang)"},"content":{"rendered":"\n

A constant is anything that doesn’t change its value. In Go const can be either of type string, numeric, boolean, and characters.<\/p>\n\n\n\n

A constant can be declared using the const<\/strong> keyword. An important point to be noted is that the value has to be assigned while declaring a constant. It is unlike variables where value can be assigned later.<\/p>\n\n\n\n