Skip to content

Support Go Modules#85

Open
SamWhited wants to merge 1 commit intohusobee:masterfrom
SamWhited:support_modules
Open

Support Go Modules#85
SamWhited wants to merge 1 commit intohusobee:masterfrom
SamWhited:support_modules

Conversation

@SamWhited
Copy link

@SamWhited SamWhited commented Jan 10, 2019

Hello,

Please consider supporting Go Modules, the new packaging standard that will be adopted fully in Go 1.12. Experimental support is in Go 1.11 and the new module paths are supported in Go 1.9.7+ and Go 1.10.3+ in a read-only manner for backwards compatibility with all supported versions of Go.

Because this library has only one external dependency (and only during testing) which already supports modules, is still v1, and is already using semver compatible tags, the go.mod file is fairly simple. The only other thing that would need to be done is to create a release after this patch is merged (eg. v1.1.1) to allow consumers of this library to pin to a version with the go.mod file.

This is fully backwards compatible because versions of Go older than 1.9.7 will ignore the mod file and import this package as they always have.

I have also taken the liberty of bumping Travis to test against supported versions of Go that are still receiving security updates, if this is incorrect and you support unsupported versions of Go, I'll happily change it back, I just thought it would be easier to test against versions that support modules.

To manage the mod file yourself in the future, use Go 1.11+ and run the command go mod tidy to include all imports in the mod file. To update dependencies, go get can be used as usual (go get -u to update all packages, or go get <library> to pull updates for an individual dep). Note that go get will never up the major version since it tries not to break your build, so you do have to manually bump that if a library makes a breaking change.

EDIT: The test failures appear to be unrelated. Tests are passing, but the coveralls secret isn't being set.

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.

1 participant