9951 explained code solutions for 126 technologies


golangHow to declare string constant


package main

const president string = "Joe" 

func main() {
  print(president)
}ctrl + c
package main

default package declaration

func main() {

declare main function that will be launched automatically

const

defines constant value

president

name of the constant

string =

constant type

Joe

constant value