Skip to content

Adding support for use with Go modules#12

Merged
mcuadros merged 1 commit intosrc-d:masterfrom
pafuent:add_support_for_go_modules
Mar 28, 2019
Merged

Adding support for use with Go modules#12
mcuadros merged 1 commit intosrc-d:masterfrom
pafuent:add_support_for_go_modules

Conversation

@pafuent
Copy link
Contributor

@pafuent pafuent commented Nov 13, 2018

Previous to this patch if you try to run the test of go-git in a Go
modules environment, the tests fail due to go-git-fixtures package is
not found. In order to found the package on this environment, the
build.Context.Import function is leveraged.

Signed-off-by: Pablo Andres Fuente pablo.andres.fuente@gmail.com

Previous to this patch if you try to run the test of go-git in a Go
modules environment, the tests fail due to go-git-fixtures package is
not found. In order to found the package on this environment, the
build.Context.Import function is leveraged.

Signed-off-by: Pablo Andres Fuente <pablo.andres.fuente@gmail.com>
@pafuent
Copy link
Contributor Author

pafuent commented Nov 13, 2018

Also I'm wondering if the whole Init() function could be replaced by the code that I added. Theoretically the Import() function should find the correct go-git-fixtures package location, without the need of finding the vendor directories for example.

@dweomer
Copy link

dweomer commented Mar 21, 2019

I am looking into writing a test for a PR against src-d/go-git#1090 and ran into many errors with fixtures because I'm not using a GOPATH because GO111MODULES=on.

Besides a seemingly unrelated panic in gopkg.in/src-d/go-git.v4/plumbing/format/index IndexSuite.TestDecodeEndOfIndexEntry this worked for me by adding a replace directive in my local go-git go.mod:

replace gopkg.in/src-d/go-git-fixtures.v3 => github.com/pafuent/go-git-fixtures add_support_for_go_modules

/cc @mcuadros

@mcuadros mcuadros merged commit 3bc7a4c into src-d:master Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants