Skip to content
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

go vet fail with dependent library #127

Closed
maitredede opened this issue Jan 5, 2020 · 7 comments
Closed

go vet fail with dependent library #127

maitredede opened this issue Jan 5, 2020 · 7 comments

Comments

@maitredede
Copy link

Describe the bug
go vet ./...

        github.com/testcontainers/testcontainers-go imports
        github.com/docker/docker/pkg/archive imports
        github.com/Sirupsen/logrus: github.com/Sirupsen/[email protected]: parsing go.mod:
        module declares its path as: github.com/sirupsen/logrus
                but was required as: github.com/Sirupsen/logrus

sirupsen/logrus#1041

To Reproduce
Referencing github.com/testcontainers/testcontainers-go v0.0.10

Expected behavior
A clear and concise description of what you expected to happen.
The error should not appear.

Additional context
It seams that the https://github.com/docker/docker repo redirects to https://github.com/moby/moby. Maybe upgrade the docker lib dependency ?

@maitredede
Copy link
Author

A possible workaround :

Add [https://github.com/testcontainers/testcontainers-go/blob/master/go.mod#L3](this line) to my project go.mod:

replace github.com/docker/docker => github.com/docker/engine v0.0.0-20190717161051-705d9623b7c1

@thaJeztah
Copy link
Contributor

Adding a replace works if you want to use a version that matches a tagged release of docker (for which tags can be found in the docker/engine repository), but if that's the reason, it's probably most most logical to pick a tag (but pin by commit, because Go doesn't accept the YY.MM tags)

Unfortunately, the replace won't help for consumers of this project though (only for the project itself); the replace is not inherited by those projects, so everyone using this package would need to add the same replace rule to their go.mod.

The additional problem is that Go 1.13 also changed some things in how it interprets the "fake" versions, which may be the culprit here.

A similar discussion can be found here as well; moby/buildkit#1297

@fbiville
Copy link
Contributor

fbiville commented Jun 29, 2020

I'm currently trying to add testcontainers to https://github.com/markfisher/rokn/, i.e. go get github.com/testcontainers/testcontainers-go and get the exact same error as in the initial description.

The replace workaround seems to work.

@thaJeztah
Copy link
Contributor

Yes, you'll have to manually specify the correct version some more details in moby/moby#39302 (comment)

@thaJeztah
Copy link
Contributor

FWIW, all tags from the docker/engine repository have been added to the upstream docker/docker (moby/moby) repository, so it should no longer be needed to use the docker/engine repository

@gianarb
Copy link
Member

gianarb commented Jul 6, 2020

Thanks @thaJeztah ! @fbiville it is not something we can fix in testcontainers. You have to replace docker/docker in your go mod with a specific tag, for example v19.03.12.
https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive

@gianarb
Copy link
Member

gianarb commented Sep 21, 2020

Go vet is now working and it is part of CI.
Thanks!

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

No branches or pull requests

4 participants