Skip to content

add module v5#100

Merged
evanphx merged 5 commits intoevanphx:masterfrom
BenTheElder:modules-v5
Mar 26, 2020
Merged

add module v5#100
evanphx merged 5 commits intoevanphx:masterfrom
BenTheElder:modules-v5

Conversation

@BenTheElder
Copy link
Copy Markdown
Contributor

ref: #98

I also encountered that the go.mod does not actually require all dependencies, a go build ./... in each module updated the go.mod. This is how the "correct module requirements" commit was generated.

I think this will still require a semver git tag afterwards

@BenTheElder
Copy link
Copy Markdown
Contributor Author

there is one remaining issue, the travis config contains:

go:
  - 1.8
  - 1.7

But modules were introduced in go 1.11 IIRC. I would suggest changing these to upstream supported go versions (1.14 and 1.13) but I'm not sure what you'd prefer.

@BenTheElder
Copy link
Copy Markdown
Contributor Author

BenTheElder commented Mar 26, 2020

I also thought about placing the go sources currently in the root at ./v5/jsonpatch instead of ./v5/ which would remove the need to do alias imports (import jsonpatch "github.com/evanphx/json-patch/v5" => import "github.com/evanphx/json-patch/v5/jsonpatch") since we're already changing the import path, but I'm not sure if that's desirable.

@evanphx
Copy link
Copy Markdown
Owner

evanphx commented Mar 26, 2020

I think leaving it at /v5 is how other modules do it? I'm fine either way honestly, esp since goimports does alias imports by default.

As for travis go ahead and just remove testing against the older versions.

@BenTheElder
Copy link
Copy Markdown
Contributor Author

ACK, I updated travis to 1.13/1.14 and left the import path. I think this should be in working shape now.

I hadn't actually needed to migrate a module to v > 1 yet, only as a consumer :-)

@evanphx
Copy link
Copy Markdown
Owner

evanphx commented Mar 26, 2020

I don't mind being the test case for how to manage this sort of thing. I consider this package my "finished project" project, in other words trying to actually have a piece of software that is done!

@evanphx
Copy link
Copy Markdown
Owner

evanphx commented Mar 26, 2020

After I merge this, I presume I just need to do another release so there is a v5.0.0 tag?

@BenTheElder
Copy link
Copy Markdown
Contributor Author

I think that's it, I am following https://blog.golang.org/v2-go-modules & https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher

https://github.com/golang/go/wiki/Modules#publishing-a-release has some notes about multi-module repos, but since the module is just at /v5 so as far as I can tell we just need a v5.0.0 tag unlike say, foo/v5/ => foo/v5.0.0 tag.

@BenTheElder
Copy link
Copy Markdown
Contributor Author

(also thanks for handling this and thanks for the super useful library!)

@evanphx evanphx merged commit 78cf029 into evanphx:master Mar 26, 2020
@BenTheElder BenTheElder deleted the modules-v5 branch March 26, 2020 22:38
@jack-janrain
Copy link
Copy Markdown

Just a heads up, I think maybe the README needs to get updated to reference v5, as it still shows v4 as the latest stable release.

@vtolstov
Copy link
Copy Markdown

thank you !

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.

4 participants