去麻烦

I decided to download go last night and see what it was all about. Trouble is, I can't get the damn thing to function. I downloaded the program, created a workspace, tried using the go install command, and nothing. I have my workspace located at C:\go\src\gocode in which is my hello.go file. I tried manually setting the GOPATH variable to this location via setx GOPATH C:\go\src\gocode, but no luck. Can anyone possibly point me in the right direction?

For a quick way to install golang on windows, try the MSI installer. The installer will only add the C:\Go\bin directory to your PATH, you need to setup the GOPATH manually in your environement settings.

From the golang site:

Under Windows, you may set environment variables through the "Environment Variables" button on the "Advanced" tab of the "System" control panel. Some versions of Windows provide this control panel through the "Advanced System Settings" option inside the "System" control panel.

Then just add a variable name GOPATH with the right location. You should choose a location different from GOROOT to ensure you don't mix standard package with yours.

The Go project provides two installation options for Windows users (besides installing from source): a zip archive that requires you to set some environment variables and an MSI installer that configures your installation automatically.

MSI installer

Open the MSI file(https://code.google.com/p/go/wiki/Downloads?tm=2) and follow the prompts to install the Go tools. By default, the installer puts the Go distribution in c:\Go.

The installer should put the c:\Go\bin directory in your PATH environment variable. You may need to restart any open command prompts for the change to take effect.

Zip archive

Download the zip(https://code.google.com/p/go/wiki/Downloads?tm=2) file and extract it into the directory of your choice (we suggest c:\Go).

If you chose a directory other than c:\Go, you must set the GOROOT environment variable to your chosen path.

Add the bin subdirectory of your Go root (for example, c:\Go\bin) to your PATH environment variable.

Setting environment variables under Windows

Under Windows, you may set environment variables through the "Environment Variables" button on the "Advanced" tab of the "System" control panel. Some versions of Windows provide this control panel through the "Advanced System Settings" option inside the "System" control panel.

This is from : http://golang.org/doc/install

Based on your preferences and requirements, try this:

In windows command console, try enter the following line, including the quote marks shown, and then hit ENTER key:

setx PATH "c\go\bin;C:\go\src\gocode"