Starting with Go on Ubuntu

So I starting to test to use the go language for some projects. Here is how i set up go on my ubuntu laptop.

 

1. Installing go language

sudo apt-get install python-software-properties 
sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang

verify

go version

2. Getting an good IDE

I uses sublime text find if here and install it

http://www.sublimetext.com/

3. Write you first line of code in GO

Start up an new file in sublime and past this in the file (I call the file main.go)

package main
import "fmt"
// this is a comment
func main() {
fmt.Println("Hello World")
}

Time to run it

mattias@mathem:~/Dokument/go/First$ go run main.go 
Hello World
mattias@mathem:~/Dokument/go/First$

There it is first run of go code

Here is where i now hang to learn more go

http://www.golang-book.com/2/index.htm

 

Leave a Reply

%d bloggers like this: