papertrail / remote_syslog2

To install, see "Releases" tab. Self-contained daemon for reading local files and emitting remote syslog (without using local syslogd).
http://help.papertrailapp.com/
MIT License
637 stars 157 forks source link

Use module-aware mode instead of GOPATH mode #238

Closed markdascher closed 2 years ago

markdascher commented 2 years ago

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 when vendor.json lists transitive dependency revisions, since they use the commit ID of the parent. Specifically, spew and difflib both used d77da356e56a7428ad25149ca77381849a6a5232 from testify. To make it do the right thing, I looked up the actual commit IDs of both packages and replaced them in vendor.json first.

go mod init github.com/papertrail/remote_syslog2
go mod tidy
rm -rf vendor
go mod vendor

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 between govendor and go mod vendor:

We 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.)

markdascher commented 2 years ago

I was able to produce the same exact executables using by running make before and after this PR's changes (with a bit of wrangling), so I think we're in good shape here.