HOME/Articles/

Golang golang-var (snippet)

Article Outline

Go programming example 'golang-var'

golang-var

Golang beginners example: golang-var

package main

// import required modules
import (
    "fmt"
)

// declare variables
var variable string

func main() {

    // define content of variable
    variable = "Lorem Ipsum Dolor Sit Amet"

    // print variable
    fmt.Println(variable)
}