Skip to content

Introduce go modules#985

Merged
gmlewis merged 6 commits intogoogle:masterfrom
marwan-at-work:mods
Aug 27, 2018
Merged

Introduce go modules#985
gmlewis merged 6 commits intogoogle:masterfrom
marwan-at-work:mods

Conversation

@marwan-at-work
Copy link
Contributor

This PR is generated by a tool I wrote that helps migrate Go packages that are tagged +2 to Semantic Import Versioning.

Note that this change should be backwards compatible and can still be imported without the /vX suffix when Go Modules is off.

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Aug 26, 2018
@gmlewis
Copy link
Collaborator

gmlewis commented Aug 27, 2018

Thank you, @marwan-at-work!

Can you please figure out why Travis CI thinks that gofmt wasn't run on one or more of the files in this PR?

@marwan-at-work
Copy link
Contributor Author

marwan-at-work commented Aug 27, 2018

@gmlewis seems that gofmt 1.11 has different rules from 1.10 and 1.9?

We can put a space between the longer field to make both gofmt's happy, but I wonder if this is worth investigating before "just making it work"

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 27, 2018

Thanks for fixing the Travis CI build, @marwan-at-work!

Since we recently removed support for Go 1.7 and bumped the version number, and this PR now removes support for Go 1.8, can you please make this semantic version be v18.0.0 and we will tag it as such when we merge the PR?

Also, can you please make the necessary change to README.md similar to the one I did here: fbd7fb9
?

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the requested v18.0.0 change and the change to README.md, this LGTM.

Awaiting second LGTM from @juliaferraioli before merging.

@gmlewis gmlewis requested a review from juliaferraioli August 27, 2018 11:28
@gmlewis
Copy link
Collaborator

gmlewis commented Aug 27, 2018

To answer your question about investigating differences in gofmt between v1.11 and v1.10, it seems pretty minor and I'm fine to move forward keeping the builds happy, but if you would like to investigate, you are welcome to, obviously.

Copy link
Contributor

@juliaferraioli juliaferraioli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marwan-at-work! LGTM.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 27, 2018

Thank you, @juliaferraioli!
Merging then bumping tagged release.

@gmlewis gmlewis merged commit 08dbadc into google:master Aug 27, 2018
@marwan-at-work
Copy link
Contributor Author

Thank you both :)

@gmlewis gmlewis mentioned this pull request Aug 30, 2018
@tmc
Copy link

tmc commented Aug 31, 2018

I think github.com/google/go-github/github/v18 in the readme is supposed to be github.com/google/go-github/v18/github.

@tmc
Copy link

tmc commented Aug 31, 2018

Perhaps the README should contain instructions for pre-go1.11 users as well?

@marwan-at-work
Copy link
Contributor Author

@tmc yes that was a typo on my end, will push a fix. Thanks for the callout!

@marwan-at-work
Copy link
Contributor Author

As for pre go 1.11, the latest Go 1.9 and 1.10 should work fine with the new import path. However they wouldn't work with Go 1.8 or before that. So before 1.8, they can just use v17 or below. But maybe the readme should just say the package requires Go1.9.X or above?

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 31, 2018

...and it does:

go-github requires Go version 1.9 or greater.

- "1.9.x"
- "1.8.x"
- master
- tip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marwan-at-work Can you please help me understand why "master" was replaced with "tip"? I tried reading the PR description and commit messages, and didn't find a rationale there.

The latest Travis CI documentation says:

or use master to get the latest version from source

That's why this change is unexpected for me and I'd like to understand it better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmitshur im not sure but it failed for me and switched to tip because we use tip at athens. I don't know the difference, but maybe we can open a pr and check?

Copy link
Collaborator

@gmlewis gmlewis Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do a quick experiment.

Update: https://travis-ci.org/google/go-github/builds/426983699 LGTM.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1002 for successful run with master.

```go
import "github.com/google/go-github/github"
import "github.com/google/go-github/github/v18"
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that modules were released very recently and are still experimental/optional, perhaps it's a good idea to expand this to have two sections: one for traditional GOPATH workspaces (with import "github.com/google/go-github/github"), and another section for module-aware environments (with import "github.com/google/go-github/v18/github").

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmitshur yes, and probably should include go get part too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indication that the PR author has signed a Google Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants