How to Install Go 1.5 on Windows 10

This tutorial will show you how to install Go 1.5 (but why?) on Windows 10. First of all you'll need to open your browser and go to http://golang.org

Click on the "Download Go" button, it will redirect to another page:

Click on the "Microsoft Windows" button, it will download an .msi file. After the download complete, run the file.

Click "Run": 

Click "Next", "Next", and so on until installed:

After finished, click the start menu, type "computer", right click on "This PC", choose "Properties":

Then choose "Advanced system settings", "Environment Variables..", click "New" on "user variables" panel.

Set the "GOPATH" to "%HOMEDRIVE%%HOMEPATH%\Documents\go" or anywhere else for your main go directory, something like this:

Click "OK" on all dialog, next, just open a "Command Prompt" window and create required directory, type 

go version
:: go version go1.5 windows/amd64
mkdir Documents\go\src
:: creating a directory, only required for the first time
cd Documents\go\src
:: change directory to %GOPATH%\src
notepad hello.go
:: edit a new source code

Create a new source code and type something like this:

package main
import `fmt`
func main() {
  fmt.Println( `Hello from Indonesia~ 1+1 =`, 1+1 )

Save, then go back to command prompt, type:

go run hello.go

A line will printed, and that's how you could install and run a example go program.
For more resources on how to learn programming in Go, please refer to the documentation (that can be viewed offline also, search for "GoDocServer" on the start menu.

There are some recommended IDE:
  1. IntelliJ IDEA with go-lang-idea-plugins
  2. LiteIDE (no-cost)
  3. Atom with go-plus (no-cost)
  4. Sublime Text with GoSublime
  5. Wide (no-cost)
  6. ZeusEdit
  7. KomodoIDE
  8. Eclipse PDE with GoClipse (no-cost)
That's it~ Btw how many "go" words in this article? 

No comments :

Post a Comment

THINK: is it True? is it Helpful? is it Inspiring? is it Necessary? is it Kind?