Giter VIP home page Giter VIP logo

gomod's Introduction

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/[email protected]

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

How to release

To create a release follow this checklist:

  1. Run go mod tidy on master. If there are changes, create a branch and PR them.
  2. Create a git tag on master branch (after above changes are merged). It is important that the tag is created on master branch. You can use git tag -as $TAG or git tag -s -m "$RELEASE_MESSAGE".
  3. Congratulations, you are done with creating a release.

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

gomod's People

Contributors

hsanjuan avatar ipfs-mgmt-read-write[bot] avatar kubuxu avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.