()
| 123 | } |
| 124 | |
| 125 | func ExamplePullRequestsService_Create() { |
| 126 | // In this example we're creating a PR and displaying the HTML url at the end. |
| 127 | |
| 128 | // Note that authentication is needed here as you are performing a modification |
| 129 | // so you will need to modify the example to provide authentication to |
| 130 | // github.NewClient(). See the following documentation for more information |
| 131 | // on how to authenticate with the client: |
| 132 | // https://pkg.go.dev/github.com/google/go-github/v88/github#hdr-Authentication |
| 133 | client, err := github.NewClient() |
| 134 | if err != nil { |
| 135 | log.Fatalf("Error creating GitHub client: %v", err) |
| 136 | } |
| 137 | |
| 138 | newPR := &github.NewPullRequest{ |
| 139 | Title: github.Ptr("My awesome pull request"), |
| 140 | Head: github.Ptr("branch_to_merge"), |
| 141 | Base: github.Ptr("master"), |
| 142 | Body: github.Ptr("This is the description of the PR created with the package `github.com/google/go-github/github`"), |
| 143 | MaintainerCanModify: github.Ptr(true), |
| 144 | } |
| 145 | |
| 146 | ctx := context.Background() |
| 147 | pr, _, err := client.PullRequests.Create(ctx, "myOrganization", "myRepository", newPR) |
| 148 | if err != nil { |
| 149 | log.Fatalf("Error creating pull request: %v", err) |
| 150 | } |
| 151 | |
| 152 | fmt.Printf("PR created: %v\n", pr.GetHTMLURL()) |
| 153 | } |
| 154 | |
| 155 | func ExampleTeamsService_ListTeams() { |
| 156 | // This example shows how to get a team ID corresponding to a given team name. |
nothing calls this directly
no test coverage detected
searching dependent graphs…