Several steps to Go Programming setup

Hello all! After my first article, I received emails. Where guys asked me “why simple-json-restapi is not working on their system?”. So I will try to explain you what you need to install. Before start to working with GO.

Let’s start

In my case I am using Windows OS (so all examples will be for windows). Don’t worry if you are using another OS. all process will be really close

  1. Follow link and download last version GO
  • for Apple OS - go1.8.darwin-amd64.pkg
  • for Windows - go1.8.windows-amd64.msi
  • for Linux - go1.8.linux-amd64.tar.gz

and install it on your system, default installation path “C:\GO”

2. Open command line and type

go version

in best case you will see

In case of an error, just add new environment variable. How to check/add it

System -> Advanced system settings -> Environment Variables -> System variables section

find variable with name Path and added new variable.

save your changes and open new command line and try to type go version again

3. let’s setup your workspace directory with subdirectories. In my case it “C:\Golang”

<YOUR WORKSPACE DIRECTORY>
- bin
- pkg
- src

NOTE : in src folder need to create your private projects.

then add new environment variable with your workspace path

So after 3 easy steps you can start working.

Let’s check

open new folder with name myfirstapp, create new file with name main.go and copy code what you see bellow

package main

import "fmt"

func main() {
fmt.Printf("/n It works :) /n")
}

so let’s run your first app, open command line and type go run main.go

Tools what you can use during writing your code

I hope this post was interesting for you. See you in next topic

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.