Custom Search

SUBSCRIBE

SUBSCRIBE : 300 + Free Video Tutorials Programming (Python, golang, Julia), DevOps

Tuesday, May 16, 2017

go golang How to install dependency packages in workspace

a)
Create workspace directory structure
$mkdir mygoproject
$cd mygoproject
$mkdir bin
$mkdir src
$mkdir pkg

b)
Export path of workspace and bin directory.
$export GOPATH=$HOME/golang_tuto/mygoproject
$export PATH=$GOPATH/bin:$PATH



c)
Install dependency packages in workspace:
$go get github.com/gorilla/mux
$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 mygoproject/bin
$ls mygoproject/src
$ls mygoproject/pkg



No comments:

Post a Comment