Go learn the language (a) Installation and Environment HelloWorld

Develop their own time, usually with mostly Java and C #, Python occasionally used to do stuff.

Want to experience more "modern" language, thought to want to come to experience the Go language.

Syria gossip less, get down to business, starting with the installation environment, this hundreds of times:

(1) to the official website to download the installation package, I use Windows platform, download "go1.13.5.windows-amd64.msi", then Step by Step install on the Ok.

    About environment variables: online face claims officer will be installed in the bin directory to the PATH environment variable , I do not have plus also can be used ( practice makes perfect ).

(2) HelloWord example:

Create a new file in the development environment folder hello:

D:\dev_repo_go>mkdir hello

D:\dev_repo_go>cd hello

Then create a new file hello.go, reads as follows:

package main
import "fmt"
func main() {
	fmt.Printf("Hello, World\n")
}
编译:
D:\dev_repo_go\hello>go build
运行:

D:\dev_repo_go\hello>hello.exe
Hello, World

(3) First impressions

    And java have the same package, you can import come in;

    End of each line is not semicolon ;

    And the java HelloWorld compared, no Class, and many simple;

Guess you like

Origin www.cnblogs.com/siweihz/p/12063923.html