Saturday, August 13, 2011

Download and Install GO language on windows

Go language was initially released for Linux systems. Recently windows version of GO language is released.
Follow below link to download Windows version of it.

Go Language Windows version

Installation of GO language is pretty easy.
1. Unzip the downloaded file on your system. Let's say C:/go
2. Set up following environmental variables.

  • GOOS = windows
  • GOARCH=386
  • GOBIN = C:/go
  • GOROOT = C:/go/bin
  • PATH = %GOBIN% (append this at the end of value PATH variable) or set the value as C:/go/bin
This is all set to run your first GO program.

Go to command prompt.
  • Execute 8g command

  • Now you have successfully setup go environment in your system.
  • Let write a first "Hello World !!!" program.
  • Type edit hello.go
  • Write the program in above snap shot. or copy it from below.
package main

    import fmt "fmt"

      func main() {
            fmt.Printf("Hello, world")
          • Save the program and come back to command prompt.
          • Compile your first GO program.
          • To compile execute 8g hello.go
          • After compilation Go compiler create .8 file. Your hello.8 file would be created after successful compile.
          • To run hello.8 file execute 8l command. 8l hello.8
          • After 8l command "8.out.exe" file will be created.
          • To see the output execute 8.out command
          Now you are in GO world. Happy Go programming.

          Let's GO.

          No comments:

          Post a Comment