golang go install package from Github



golang go install package from Github

golang go install package from Github

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 fo workspace.
$ls myproject/bin
$ls myproject/src
$ls myproject/pkg
http://fosshelp.blogspot.com/2017/05/golang-go-how-to-install-package-from.html