'Language/Golang'에 해당되는 글 1건

  1. 2015.08.31 Install Golang on Ubuntu 14.04
2015.08.31 01:42

1. install

$ sudo apt-get update

$ sudo apt-get upgrade -y

$ sudo apt-get install golang -y

$ sudo apt-get install git -y


# create project directory

$ mkdir $HOME/go

$ mkdir $HOME/go/bin


2. Setting path

$ echo "export GOROOT=/usr/lib/go" >> /home/vagrant/.bashrc

$ echo "export GOBIN=/usr/bin/go" >> /home/vagrant/.bashrc

$ echo "export GOPATH=$HOME/go" >> /home/vagrant/.bashrc

$ echo "export PATH=$PATH:$GOPATH/bin:$GOROOT/bin" >> /home/vagrant/.bashrc


3. Download library

go get {URL}

$ go get github.com/gorilla/mux

$ go get github.com/gorilla/sessions


4. Sample

keyvalue.go

- http://localhost:8080/mapstore/set/{key}/{value}

- http://localhost:8080/mapstore/get/{key}

Posted by CoolDragon

댓글을 달아 주세요