{"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 A constant is anything that doesn’t change its value. In Go const can be either of type string, numeric, boolean, and characters. A constant can be declared using the const keyword. An…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[3,4],"class_list":["post-4127","post","type-post","status-publish","format-standard","hentry","category-tech","tag-go","tag-golang"],"yoast_head":"\nconst c string = \"circle\"<\/code><\/pre>\n\n\n\n
const c = \"circle\"<\/code><\/pre>\n\n\n\n
const (\n c = \"circle\"\n s = \"square\"\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"