-
Notifications
You must be signed in to change notification settings - Fork 158
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
Use module-aware mode instead of GOPATH mode #238
Conversation
Makefile
Outdated
type gox >/dev/null 2>&1 || { \ | ||
echo "\033[1;33mGox is not installed. See https://github.com/mitchellh/gox\033[m"; \ | ||
echo "$$ go get github.com/mitchellh/gox"; \ | ||
echo "$$ go install github.com/mitchellh/gox@latest"; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it would be safer to pin this to a specific version? @tillberg what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this command run in CI? If so, then this should use a cryptographic hash for the version reference. Otherwise, I think I'm hesitant to weigh in one way or the other :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not part of CI, but it is part of the manual build/release process. I like the idea of making the version explicit. Added tools.go
in cb74f9f based on this technique, which seems to be as good as it gets while we wait for golang/go#48429.
This could've been messy if gox
shared any dependencies with remote_syslog2
itself, but I confirmed there weren't any shared dependencies.
@@ -1,6 +1,6 @@ | |||
# remote_syslog2 | |||
|
|||
[![Download remote_syslog2](http://papertrail.github.io/remote_syslog2/images/download.png)][releases] | |||
[![Download remote_syslog2](https://papertrail.github.io/remote_syslog2/images/download.png)][releases] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed all http://
links to https://
while I was in here. Confirmed that the new links all work.
README.md
Outdated
go get github.com/kardianos/govendor | ||
go get github.com/mitchellh/gox | ||
go get github.com/papertrail/remote_syslog2 | ||
go install github.com/mitchellh/gox@latest | ||
git clone [email protected]:papertrail/remote_syslog2.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://golang.org/doc/go-get-install-deprecation
golang/go#31529 (comment) discusses using git clone
instead of go get
for local development
@@ -66,7 +66,7 @@ func TestRawConfig(t *testing.T) { | |||
assert.Equal(c.Facility, fac) | |||
assert.NotEqual(c.Hostname, "") | |||
assert.Equal(c.Poll, false) | |||
assert.Equal(c.RootCAs, papertrail.RootCA()) | |||
assert.Equal(c.RootCAs.Subjects(), papertrail.RootCA().Subjects()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See golang/go#45891 and golang/go#46057
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was able to produce the same exact executables using by running |
GOPATH development mode will be removed from Go any day now. This PR makes the necessary adjustments to use module-aware mode instead. This also eliminates the need for
govendor
, which is obsolete.The majority of changes come from running the commands below. NOTE:
go mod init
gets confused whenvendor.json
lists transitive dependency revisions, since they use the commit ID of the parent. Specifically,spew
anddifflib
both usedd77da356e56a7428ad25149ca77381849a6a5232
fromtestify
. To make it do the right thing, I looked up the actual commit IDs of both packages and replaced them invendor.json
first.Afterwards, I ran
PACKAGE_VERSION=0.20 make
to confirm that everything still tests and builds successfully. Also confirmed that the resulting vendor folder was identical, accounting for some minor differences betweengovendor
andgo mod vendor
:// +build ignore
is omitted.github.com/howbazaar/loggo/example
, possibly because it was an unused package..gitignore
ortravis.yml
cmd/go: prune non-source files in 'go mod vendor' golang/go#33261We could also consider dropping the vendor folder entirely, but it doesn't hurt to keep it for now. (And especially for this PR, makes it more obvious that nothing has changed.)