Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce go modules #985

Merged
merged 6 commits into from Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions .travis.yml
@@ -1,13 +1,16 @@
sudo: false
language: go
go:
- "1.11.x"
- "1.10.x"
- "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.

env:
global:
- GO111MODULE=on
matrix:
allow_failures:
- go: master
- go: tip
fast_finish: true
env:
secure: "IrnPmy/rkIP6Nrbqji+u7MCAibQlA6WvPLEllmDQ2yZP/uIe3wLwwYbTu9BOkgzoLA+f8PA6u3pp/RhY/rtaM4NzHAO2nVfGIv9UHUQ3NGq0DYS6rODjVKhq7vkhELoagRewyqFVN4rE0LnExkknRMgjQfRke6/DA7u7Xm8JyhY=" # COVERALLS_TOKEN
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -4,15 +4,15 @@

go-github is a Go client library for accessing the [GitHub API v3][].

go-github requires Go version 1.8 or greater.
go-github requires Go version 1.9 or greater.

If you're interested in using the [GraphQL API v4][], the recommended library is
[shurcooL/githubv4][].

## Usage ##

```go
import "github.com/google/go-github/github"
import "github.com/google/go-github/github/v17"
```
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?


Construct a new GitHub client, then use the various services on the client to
Expand Down
2 changes: 1 addition & 1 deletion example/appengine/app.go
Expand Up @@ -12,7 +12,7 @@ import (
"net/http"
"os"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/oauth2"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
Expand Down
2 changes: 1 addition & 1 deletion example/basicauth/main.go
Expand Up @@ -16,7 +16,7 @@ import (
"strings"
"syscall"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
2 changes: 1 addition & 1 deletion example/commitpr/main.go
Expand Up @@ -31,7 +31,7 @@ import (
"strings"
"time"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/oauth2"
)

Expand Down
2 changes: 1 addition & 1 deletion example/migrations/main.go
Expand Up @@ -11,7 +11,7 @@ package main
import (
"context"
"fmt"
"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/oauth2"
)

Expand Down
2 changes: 1 addition & 1 deletion example/newrepo/main.go
Expand Up @@ -16,7 +16,7 @@ import (
"log"
"os"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/oauth2"
)

Expand Down
2 changes: 1 addition & 1 deletion example/simple/main.go
Expand Up @@ -12,7 +12,7 @@ import (
"context"
"fmt"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
)

// Fetch all the public organizations' membership of a user.
Expand Down
2 changes: 1 addition & 1 deletion github/examples_test.go
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"log"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
)

func ExampleClient_Markdown() {
Expand Down
9 changes: 5 additions & 4 deletions github/projects_test.go
Expand Up @@ -20,11 +20,12 @@ func TestProjectsService_UpdateProject(t *testing.T) {
defer teardown()

input := &ProjectOptions{
Name: String("Project Name"),
Body: String("Project body."),
State: String("open"),
Name: String("Project Name"),
Body: String("Project body."),
State: String("open"),
Public: Bool(true),

OrganizationPermission: String("read"),
Public: Bool(true),
}

mux.HandleFunc("/projects/1", func(w http.ResponseWriter, r *http.Request) {
Expand Down
11 changes: 11 additions & 0 deletions go.mod
@@ -0,0 +1,11 @@
module github.com/google/go-github/v18

require (
github.com/golang/protobuf v1.2.0 // indirect
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d // indirect
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87 // indirect
google.golang.org/appengine v1.1.0
)
14 changes: 14 additions & 0 deletions go.sum
@@ -0,0 +1,14 @@
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 h1:zLTLjkaOFEFIOxY5BWLFLwh+cL8vOBW4XJ2aqLE/Tf0=
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg=
golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87 h1:GqwDwfvIpC33dK9bA1fD+JiDUNsuAiQiEkpHqUKze4o=
golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
2 changes: 1 addition & 1 deletion test/fields/fields.go
Expand Up @@ -25,7 +25,7 @@ import (
"reflect"
"strings"

"github.com/google/go-github/github"
"github.com/google/go-github/v18/github"
"golang.org/x/oauth2"
)

Expand Down