This is a creation in Article, where the information may have evolved or changed.
Windows Go language development environment building
Golang is Google's second programming language, but unlike Golang and Dart, Golang is a system-level programming language, meaning that he and C + + and Java are the same type of language. Learning Golang is my own hobby and interest, I am more optimistic about this language, after all, the language is in the C + +, Java, Javascript, Python and other powerful and extremely popular language was born, he is to compensate for the shortcomings of the existing programming language, extract their essence. This creates a scenario that adapts to contemporary rapid development and iteration, embracing change, big data, multicore high concurrency. The language is claimed to be: the internet era of C. This means: 1. With the characteristics of Internet web development, that is, the development of high efficiency; 2. The same speed as the C language, that is, the operation is efficient. Believe that these two characteristics will let you find a destination. Hope Golang can be popular, let everyone see its charm. Here are the steps to build your go language development environment:
1. Installation
There are three ways to install the Go language
* Go源码安装:[参考链接](http://www.jb51.net/article/56778.htm)* Go标准包安装:[下载地址](https://golang.org/dl/)* 第三方工具安装
Go environment variables and working directory
According to the Convention, 3 directories need to be established under Gopath:
* bin(存放编译后生成的可执行文件)* pkg(存放编译后生成的包文件)* src(存放项目源码)
The GO command relies on an environment variable: Gopath, this is not the Go installation directory, but your work (project) directory (your code will be in that directory). Gopath can have more than one, Windows is separated by semicolons (;), the Linux system is a colon (:), when there are multiple Gopath, the default is to put the contents of go get in the first directory. Here we create a new Gopath variable, in my case: E:\LuckyCat\go.
The installation steps on Windows are as follows:
* 下载Go开发环境:https://golang.org/dl/* 如果你下载的是exe或者msi的安装包,就直接安装了,不需要配置环境变量* 如果下载的zip,就将其解压;配置环境变量* * GOROOT = E:\LuckyCat\go * GOBIN = %GOROOT%\bin (现在的go1.5已经不需要配置这个环境变量了) * GOARCH = amd64 (如果你的系统是32位则是386,如果是64位则是amd64)(现在的go1.5已经不需要配置这个环境变量了) * GOOS = windows (如果你的操作系统是windows,如果是linux请写linux)(现在的go1.5已经不需要配置这个环境变量了) * path:如果末尾如有没有分号,则添加之,然后再末尾添加%GOROOT%\bin* 安装好了后,在cmd中运行go,如果出现go命令的帮助信息,则go开发环境安装正确。
Installation on Linux, FreeBSD, OS x please see http://ioio.name/golang-install.html or the official website of the introduction: http://golang.org/doc/install.html
2. Testing (under Windows)
Create a file from anywhere: Gotest.go
Save after writing the following code:
package mainimport ( "fmt")func main() { fmt.Println("hello world!")}
In cmd, under the path to the file, use the command to compile, link, and execute
Go run gotest.go
If the output Hello world! indicates a successful installation of the development environment
The performance of Go 1 is also gratifying, compared to the new performance comparison test for Go 1 and node. JS: http://www.cnblogs.com/QLeelulu/archive/2012/08/12/2635261.html
3. Development tools
* goclipse(很完善的go语言在eclipse上的插件)
Installation steps:
1) Help–>eclipse Marketplace Search Goclipse Installation
2) Configure the GIT environment Windows–>preferences–>go