This is a creation in Article, where the information may have evolved or changed.
//Please keep the file encoded as UTF-8Package Main//The program entry package must be mainImport"FMT" //Importing a package that uses features can be used in the precedingvarAint //defines that the global variable is initially zero, and the type is behind. Unspecified, standard type is zero, others are nilvar(//Multi-Assignment methodA1intA2stringa3,a4=1,2)varI= -Func Main () {//parentheses cannot be wrapped.b:=3 //you can omit the var auto-deduction type: Only within the functionc,d,e:=4,5,6 //assigning values in parallel modeF:=[]string{"str1","str2"}//initial curly braces and assigning values to the array,G:=[...]int{4:0}//Use index reverse to determine the range and populate an array with an auto-extended sizeh:=[2][2]string{{"row:0_col:0","row:0_col:1"},{"row:1_col:0","row:1_col:1"}}//multidimensional array Here The compiler takes a line-first scani:= the+i//if the local is in conflict with a global variable, local precedence within the functionFmt. Println ("Hello World", b,c,d,e,f,g,h[0][1],i)//The semicolon does not add, the first letter uppercase for other packages available like public}