Custom Search

Tuesday, May 16, 2017

golang go how to install package from Github

a)
Create workspace directory structure

$mkdir myproject
$cd myproject
$mkdir bin
$mkdir src
$mkdir pkg

b)
Export path of workspace and bin directory.

$export GOPATH=$HOME/golang_tuto/myproject
$export PATH=$GOPATH/bin:$PATH






c)
Install dependency packages in workspace:

$go get github.com/gorilla/mux
$go get -u github.com/gorilla/mux

$go get golang.org/x/crypto/bcrypt
$go get -u golang.org/x/crypto/bcrypt

$go get golang.org/x/tools/cmd/goimports

d)
Then check bin, src and pkg directories of workspace.

$ls myproject/bin
$ls myproject/src
$ls myproject/pkg

No comments:

Post a Comment