This is a creation in Article, where the information may have evolved or changed.
The Go program is made up of packages.
The entrance to the program is the package ' main '
Import package using import statement (similar to C-language include)
When a package is imported, it is invoked with the exported name (the exported name is capitalized)
The function in go declares that the arguments in the function can have no arguments or accept multiple arguments. The type declaration is after the parameter name and the function definition.
The return value of Go can be named after the same as the variable to use.
The VAR statement defines a list of variables that are declared after the variable name. If initialization is using an expression, you can omit the type declaration, and the variable will determine the type based on the initial value.
A variable is assigned a value of zero when it is not explicitly initialized
The ": =" simple assignment statement can be used instead of the keyword "var". Each statement outside the function must start with a keyword, ": =" A concise assignment statement cannot be used outside of a function
The expression T (v) is the type that converts v to T. Unlike the C language: Go in different types of target assignment is required to display the conversion
The definition of a constant uses the keyword "const". Constants cannot be defined using the ": =" syntax.