How to use local versions of glide dependencies?

I am working on a Go project that uses Glide to manage dependencies. I need to make changes to the project, but also to several dependencies used by the project. I need to check these changes together before making changes to each project separately.

How can I tell Glide (or Go) to use local versions of these projects (for example, found in $GOPATH/src/...) instead of dumping something and stuffing it into a directory vendor)?

To give an example:

  • github.com/hyperledger/burrow depends on:
  • github.com/tendermint/tendermintwhich depends on:
  • github.com/tendermint/go-crypto

I need to make some changes covering all three projects. I want to check the changes by following the steps in the project burrow, but I need it to run my development versions tendermintand go-cryptowhich I have locally.

+6
source share
2 answers

If you want to test the dependencies under "$ GOPATH / src / ...", just temporarily delete each glide path file in the root of your project (glide.yaml, glide.lock, etc.). You can then return these files if you need to reuse provider dependencies.

Update 1

, , glide glide.yaml . :

repo:      , .           , .      .

- (GitHub Gitlab $GOPATH/src/github.com/hyperledger/burrow, ), glide.yaml:

- package: github.com/tendermint/tendermint <-- vendor name dependencies
  repo:    github.com/myrepo/tendermint   <-- your remote fork
  version: vx.x.x or your sha commit code

, . , :

- package: github.com/tendermint/tendermint <-- vendor name dependencies
#  repo:    github.com/myrepo/tendermint   <-- your remote fork
#  version: vx.x.x or your sha commit code

, , , .

2

- :

     , .      ,      (CI)      .

, , , :

$ glide mirror set github.com/tendermint/tendermint file:///User/yourname/Gospace/src/github.com/tendermint/tendermint

mirror.yaml GLIDE_HOME ( , USER/.glide). ( GOPATH) ( ). , :

$ glide mirror remove github.com/tendermint/tendermint
+6

, Go /vendor , GOPATH Glide /vendor, glide install, , ( ) /vendor, Go vendoring , GOPATH.

, , , glide.yaml, .

.

+4

All Articles