Eclipse installation under Windows Goclipse Configuration Golang development environment
Eclipse installation under Windows Goclipse Configuration Golang development environment, Liteide Golang configuration is introduced
1. Download Goclipse Eclipse plugins
Http://pan.baidu.com/s/1c0weLgO
After installing the plug-in, you can see a Golang logo in the upper right corner of Eclipse, the Gopher icon:
2. Download Golang, debug tools
Download Golang Windows version currently using Go1.3.3.windows-386.zip:https://storage.googleapis.com/golang/go1.3.3.windows-386.zip
Use proxy to access the site to get the latest version: https://golang.org/dl/
Download liteidex24.3.windows.7z:
Https://github.com/visualfc/liteide#website
The main use of liteide inside the GDB (for Debugging Go Program), and Gocode (to ecplise Add code automatically hint), of course, can also use liteide to develop the go APP
Golang1.3.3-windows-386 has been put to Baidu-network disk, to provide download: Http://pan.baidu.com/s/1jGuu8eU
The file check code is:
SHA1 HASH:BA99083B22E0B22B560BB2D28B9B99B405D01B6BMD5 Hash:17d08e9801f239680b21b42c94c877ae
3. Configuration parameters
Unzip go1.3.3.windows-386.zip to directory such as: E:/go
Unzip the Liteidex to the directory, as
Configuring Golang Environment variables
Goroot = E:/go
Path increases%goroot%/bin;
Command line enter go version to view go versions:
Configure the Liteide Golang environment:
Configure Eclipse Go Preferences:
Debugger Governor selection: E:/programfiles/liteide/bin/gdb.exe (under Liteide)
Gocode Code hint configuration:
After installing Goclipse, Gocode is selected according to the version of Windows,
such as%eclipse_home%/plugins/com.googlecode.goclipse.gocode_0.7.6.v450/tools/windows_386/gocode.exe
Configuration complete Eclipse new Go project:
Demo.go
Package Main
Import (
"FMT"
"Io/ioutil"
"Net/http"
)
Func Main () {
URL: = "http://www.baidu.com"
Resp, _: = Getbyproxy (URL)
Fmt. Println (RESP)
Defer resp. Body.close ()
Body, _: = Ioutil. ReadAll (resp. Body)
Fmt. Println (String (body))
}
HTTP Get by proxy
Func getbyproxy (url_addr string) (*http. Response, error) {
Request, Err: = http. Newrequest ("GET", url_addr, nil)
If err! = Nil {
return nil, err
}
Return HTTP. Defaultclient.do (Request)
}
Go: Eclipse installation under Windows Goclipse Configuration Golang development environment