Skip to content

Adding support for use with Go modules #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2019

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

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