inconshreveable / log15

Structured, composable logging for Go
https://godoc.org/github.com/inconshreveable/log15
Other
1.1k stars 145 forks source link

Add Go module support #162

Closed muhlemmer closed 1 year ago

muhlemmer commented 4 years ago

This PR adds a go.mod file and closes #152

As per recommendations from the Go Modules wiki page:

  1. To fully implement this module support a new major release needs to be done (v3)
  2. Therefore, I've changed import paths in this package to reflect this: log "github.com/inconshreveable/log15/v3"
  3. Readme is updated accordingly.
  4. Personal experience: Go expects a 3-numbered version, or modules will not work. So next release should be tagged like v3.0.0
  5. It is recommended (but not required) to keep a separate v3 branch from which v3 releases are done. This has to do with long term support of individual module versions.

Go version support

Modules is supported by Go versions 1.9.7+, 1.10.3+, or 1.11+. 1.9 is the lowest version in .travis.yml. Hence, go.mod has go 1.9 as minimal supported version for this package.

Tested

I've done a test release on my own fork of this repository to verify things are done right. I've tested go get and module versioning in a dependent package.

Note: package name in my test release reflects my own repository path, while this PR reflects github.com/inconshreveable/log15

In go.mod:

require github.com/usrpro/log15/v3 v3.1.0

Import:

import log "github.com/usrpro/log15/v3"

Ran:

$ go get -u -v ./...
go: downloading github.com/usrpro/log15/v3 v3.1.0
github.com/usrpro/log15/v3

All worked OK :ballot_box_with_check:

kishaningithub commented 2 years ago

@inconshreveable It would be awesome if this pr can be merged