After download and move to your interested folder, add this line to ~/.bashrc and ~/.profile
export GOPATH=$HOME/gowork
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
After download and move to your interested folder, add this line to ~/.bashrc and ~/.profile
export GOPATH=$HOME/gowork
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH/bin
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
// import "github.com/julienschmidt/httprouter" | |
// example router | |
// Serve static files for Assets | |
router := httprouter.New() | |
router.GET("/fonts/*filepath", fileHandler("/fonts/")) | |
router.GET("/styles/*filepath", fileHandler("/styles/")) | |
router.GET("/scripts/*filepath", fileHandler("/scripts/")) | |
router.GET("/img/*filepath", fileHandler("/img/")) |