Skip to content
forked from ipfs/gomod

Tips, tricks and scripts for gomod

Notifications You must be signed in to change notification settings

anacrolix/gomod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Go Modules

Go Modules introduce new way to manage dependencies but also new hurdles of using them. In here we will gather knowledge, tools and other bits to ease up use of go modules.

Updating modules

To simply update dependency to newer tagged version:

go get github.com/ipfs/go-cid@v0.0.2

It is not required to update all after a new version is released. In general update update modules that use the new functionality or require fixes.

Dev workflow

Use local replace directives for developing. Example:

replace github.com/ipfs/go-cid => ../go-cid

To test out in CI, commit and push the dependency to a branch and then run:

go get github.com/ipfs/go-cid@$HASH

to update the version. You can also replace $HASH with branch name.

If for some reason version in the build did not change (caused by off master tags). Use replace directive like this:

replace github.com/ipfs/go-cid => github.com/ipfs/go-cid@$HASH

CI Config

Here is a config for Travis CI: travis.example.yml

Git hook to prevent pushing local replace directives

The pre-commit hook will alert you, when you are trying to commit go.mod file with local replace directives. This is useful pattern for developing but has no place on remote.

It is best to install it as global githook. Instructions here

About

Tips, tricks and scripts for gomod

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published