ikeikeikeike / go-sitemap-generator

go-sitemap-generator is the easiest way to generate Sitemaps in Go
https://github.com/ikeikeikeike/go-sitemap-generator
MIT License
220 stars 65 forks source link

Support Go Modules #27

Closed SamWhited closed 5 years ago

SamWhited commented 5 years ago

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 libraries external dependencies already support semver compatible tags, the go.mod file is fairly simple. The only other thing that would need to be done is to create a semver compatible tag after this patch is merged (eg. v2.0.2) to allow other things to pin to that version without having to use the special "incompatible" version string used for projects that are v2 and up but don't have the major version declared in the module line.

As part of this I have reduced the versions of Go this library is tested against to only supported versions of Go that receive security updates, and one more (1.9) because everything appeared to work there and it supported modules. Older versions of go however, should be able to use this package just as they did before since they'll ignore the mod file anyways.

Thank you for your consideration.

EDIT: my only concern is that I'm not sure what the canonical import path for this project is, the readme mentions both github.com/ikeikeikeike/go-sitemap-generator and gopkg.in/ikeikeikeike/go-sitemap-generator.v2. Modules provides some workarounds for the gopkg.in imports IIRC, but it's probably worth having a canonical path all the same.

SamWhited commented 5 years ago

Gentle ping

ikeikeikeike commented 5 years ago

Thanks, this repo is gonna be merged v1 and v2 by the 'go mod' Semantic Import Versioning instead of gopkg.in used.