Variables

Constants in Go

A constant expression is a variable which cannot have its value changed after declaration. These expressions are evaluated at compile time.


Syntax
const constantName = value

Notes

There are several types of constants (including boolean, integer, floating point, and string), all provided in the Go specification. The type does not need to be provided.


Example
const site = "SyntaxCenter.com"

< Variable Declaration   |   Pointers >

© 2018 SyntaxDB. All Rights Reserved.