GoLang Project Dependencies

This post talks about the general use of glang dep across golang projects.

To Begin with, refer to :https://medium.freecodecamp.org/an-intro-to-dep-how-to-manage-your-golang-project-dependencies-7b07d84e7ba5

How to Install golang dep refer here : https://github.com/golang/dep on macOS High Sierra (version 10.13.3)

esumits-MacBook-Pro:~ esumit$ brew install dep

Updating Homebrew…

==> Installing dependencies for dep: go

==> Installing dep dependency: go

==> Downloading https://homebrew.bintray.com/bottles/go-1.10.2.high_sierra.bottl

######################################################################## 100.0%

==> Pouring go-1.10.2.high_sierra.bottle.tar.gz

==> Caveats

A valid GOPATH is required to use the `go get` command.

If $GOPATH is not specified, $HOME/go will be used by default:

  https://golang.org/doc/code.html#GOPATH

You may wish to add the GOROOT-based install location to your PATH:

  export PATH=$PATH:/usr/local/opt/go/libexec/bin

==> Summary

🍺  /usr/local/Cellar/go/1.10.2: 8,161 files, 336.7MB

==> Installing dep

==> Downloading https://homebrew.bintray.com/bottles/dep-0.4.1_1.high_sierra.bot

######################################################################## 100.0%

==> Pouring dep-0.4.1_1.high_sierra.bottle.tar.gz

🍺  /usr/local/Cellar/dep/0.4.1_1: 7 files, 8.8MB

esumits-MacBook-Pro:~ esumit$

Check Dep Version

esumits-MacBook-Pro:~ esumit$ dep version

dep:

version     : v0.4.1

build date  : 2018-01-27

git hash    : 37d9ea0

go version  : go1.9.3

go compiler : gc

platform    : darwin/amd64

esumits-MacBook-Pro:~ esumit$

esumits-MacBook-Pro:~ esumit$ dep –help

Dep is a tool for managing dependencies for Go projects

Usage: “dep [command]”

Commands:

  init     Set up a new Go project, or migrate an existing one

  status   Report the status of the project’s dependencies

  ensure   Ensure a dependency is safely vendored in the project

  prune    Pruning is now performed automatically by dep ensure.

  version  Show the dep version information

Examples:

  dep init                               set up a new project

  dep ensure                             install the project’s dependencies

  dep ensure -update                     update the locked versions of all dependencies

  dep ensure -add github.com/pkg/errors  add a dependency to the project

Use “dep help [command]” for more information about a command.

esumits-MacBook-Pro:~ esumit$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s