Skip to content

Instantly share code, notes, and snippets.

@bernie-haxx
Forked from xXPhenomXx/golang_setup
Created November 4, 2018 14:09
Show Gist options
  • Save bernie-haxx/041143aa8b6244e2e7640949f9d3030a to your computer and use it in GitHub Desktop.
Save bernie-haxx/041143aa8b6244e2e7640949f9d3030a to your computer and use it in GitHub Desktop.
Go Setup on Ubuntu & Revel
** To install Golang on Ubuntu 17.xx server **
sudo add-apt-repository ppa:gophers/archive
sudo apt-get update
sudo apt-get install golang-1.9-go
export PATH=$PATH:/usr/lib/go-1.9/bin
go version (To verify its mapped correctly, should see something like: go version go1.9.2 linux/amd64)
* make a directory for your go applications, I use /home/apps/go
export GOPATH=/home/apps/go
(Now from inside your /home/apps/go folder you can start creating your go apps)
** To install Revel, cd into /home/apps/go **
go get github.com/revel/revel
go get github.com/revel/cmd/revel
export PATH="$PATH:$GOPATH/bin"
revel new your-app
revel run your-app
Some often used Golang packages:
go get -u github.com/flosch/pongo2 (pongo2 templating engine)
go get golang.org/x/crypto/bcrypt (Password Hashing)
https://gowebexamples.com/password-hashing/
go get gopkg.in/mgo.v2 (MongoDB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment