Package Level Variables Golang tutorial 6

Package Level Variables Golang tutorial 6

It should start with camel case and outside main function.

 


var moonSun int = 420 // package level variable
func main(){}

Source Code


package main
import "fmt"

var moonSun int = 420
func main(){
fmt.Print( moonSun );
}

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: