Several steps to Go Programming setup

Andriy Lesch
Feb 24, 2017 · 2 min read

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

Andriy Lesch

Written by

software engineer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade