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

Switch to go mod and update some dependencies #5

Merged
merged 1 commit into from
Apr 7, 2019

Conversation

mihaitodor
Copy link
Contributor

@mihaitodor mihaitodor commented Apr 5, 2019

Hey @relistan I made an experiment with go mod in this repo before doing Sidecar. Seems to be more or less straight-forward, although it does expect to be able to fetch the vendored dependencies from the internet during the migration. In this case, it went fine.

Other changes:

  • Update Travis Go version to 1.12
  • Convert Sirupsen/logrus to sirupsen/logrus

@mihaitodor mihaitodor requested a review from relistan April 5, 2019 17:25
@relistan
Copy link
Collaborator

relistan commented Apr 5, 2019

Sounds good, but why are there 679k fewer lines of code in here? Do the modules contain that much less stuff?

@mihaitodor
Copy link
Contributor Author

mihaitodor commented Apr 5, 2019

I was surprised by that as well. Looks like go mod removes a lot of stuff when vendoring, such as tests. I have mixed feelings about that, but, apparently, it's by design (see here a comment from Russ Cox).

According to the docs setting GOFLAGS=-mod=vendor (like I did in .travis) instructs the build tool to not download dependencies from the internet, so all the dependencies need to be present in the vendor folder or, otherwise, it will fail to build:

The -mod=vendor flag (e.g., go build -mod=vendor) instructs the go commands to use the main module's top-level vendor directory to satisfy dependencies. The go commands in this mode therefore ignore the dependency descriptions in go.mod and assume that the vendor directory holds the correct copies of dependencies. Note that only the main module's top-level vendor directory is used; vendor directories in other locations are still ignored.

- Update Travis Go version to 1.12
- Convert Sirupsen/logrus to sirupsen/logrus
Copy link
Collaborator

@relistan relistan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mihaitodor mihaitodor merged commit 3bc0652 into master Apr 7, 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.

2 participants