Skip to content

Commit c1d8f50

Browse files
authored
Merge pull request #88 from cli/mntlty/example_gh_test_package
Change package in `example_gh_test.go` to `gh_test`
2 parents e3ec45f + 114787b commit c1d8f50

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

example_gh_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package gh
1+
package gh_test
22

33
import (
44
"fmt"
@@ -7,6 +7,7 @@ import (
77
"os"
88
"time"
99

10+
gh "github.com/cli/go-gh"
1011
"github.com/cli/go-gh/pkg/api"
1112
"github.com/cli/go-gh/pkg/tableprinter"
1213
"github.com/cli/go-gh/pkg/term"
@@ -16,7 +17,7 @@ import (
1617
// Execute 'gh issue list -R cli/cli', and print the output.
1718
func ExampleExec() {
1819
args := []string{"issue", "list", "-R", "cli/cli"}
19-
stdOut, stdErr, err := Exec(args...)
20+
stdOut, stdErr, err := gh.Exec(args...)
2021
if err != nil {
2122
log.Fatal(err)
2223
}
@@ -26,7 +27,7 @@ func ExampleExec() {
2627

2728
// Get tags from cli/cli repository using REST API.
2829
func ExampleRESTClient_simple() {
29-
client, err := RESTClient(nil)
30+
client, err := gh.RESTClient(nil)
3031
if err != nil {
3132
log.Fatal(err)
3233
}
@@ -47,7 +48,7 @@ func ExampleRESTClient_advanced() {
4748
Headers: map[string]string{"Time-Zone": "America/Los_Angeles"},
4849
Log: os.Stdout,
4950
}
50-
client, err := RESTClient(&opts)
51+
client, err := gh.RESTClient(&opts)
5152
if err != nil {
5253
log.Fatal(err)
5354
}
@@ -64,7 +65,7 @@ func ExampleRESTClient_request() {
6465
opts := api.ClientOptions{
6566
Headers: map[string]string{"Accept": "application/octet-stream"},
6667
}
67-
client, err := RESTClient(&opts)
68+
client, err := gh.RESTClient(&opts)
6869
if err != nil {
6970
log.Fatal(err)
7071
}
@@ -93,7 +94,7 @@ func ExampleRESTClient_request() {
9394

9495
// Query tags from cli/cli repository using GQL API.
9596
func ExampleGQLClient_simple() {
96-
client, err := GQLClient(nil)
97+
client, err := gh.GQLClient(nil)
9798
if err != nil {
9899
log.Fatal(err)
99100
}
@@ -126,7 +127,7 @@ func ExampleGQLClient_advanced() {
126127
EnableCache: true,
127128
Timeout: 5 * time.Second,
128129
}
129-
client, err := GQLClient(&opts)
130+
client, err := gh.GQLClient(&opts)
130131
if err != nil {
131132
log.Fatal(err)
132133
}
@@ -154,7 +155,7 @@ func ExampleGQLClient_advanced() {
154155

155156
// Get repository for the current directory.
156157
func ExampleCurrentRepository() {
157-
repo, err := CurrentRepository()
158+
repo, err := gh.CurrentRepository()
158159
if err != nil {
159160
log.Fatal(err)
160161
}

0 commit comments

Comments
 (0)