1
- package gh
1
+ package gh_test
2
2
3
3
import (
4
4
"fmt"
7
7
"os"
8
8
"time"
9
9
10
+ gh "github.com/cli/go-gh"
10
11
"github.com/cli/go-gh/pkg/api"
11
12
"github.com/cli/go-gh/pkg/tableprinter"
12
13
"github.com/cli/go-gh/pkg/term"
@@ -16,7 +17,7 @@ import (
16
17
// Execute 'gh issue list -R cli/cli', and print the output.
17
18
func ExampleExec () {
18
19
args := []string {"issue" , "list" , "-R" , "cli/cli" }
19
- stdOut , stdErr , err := Exec (args ... )
20
+ stdOut , stdErr , err := gh . Exec (args ... )
20
21
if err != nil {
21
22
log .Fatal (err )
22
23
}
@@ -26,7 +27,7 @@ func ExampleExec() {
26
27
27
28
// Get tags from cli/cli repository using REST API.
28
29
func ExampleRESTClient_simple () {
29
- client , err := RESTClient (nil )
30
+ client , err := gh . RESTClient (nil )
30
31
if err != nil {
31
32
log .Fatal (err )
32
33
}
@@ -47,7 +48,7 @@ func ExampleRESTClient_advanced() {
47
48
Headers : map [string ]string {"Time-Zone" : "America/Los_Angeles" },
48
49
Log : os .Stdout ,
49
50
}
50
- client , err := RESTClient (& opts )
51
+ client , err := gh . RESTClient (& opts )
51
52
if err != nil {
52
53
log .Fatal (err )
53
54
}
@@ -64,7 +65,7 @@ func ExampleRESTClient_request() {
64
65
opts := api.ClientOptions {
65
66
Headers : map [string ]string {"Accept" : "application/octet-stream" },
66
67
}
67
- client , err := RESTClient (& opts )
68
+ client , err := gh . RESTClient (& opts )
68
69
if err != nil {
69
70
log .Fatal (err )
70
71
}
@@ -93,7 +94,7 @@ func ExampleRESTClient_request() {
93
94
94
95
// Query tags from cli/cli repository using GQL API.
95
96
func ExampleGQLClient_simple () {
96
- client , err := GQLClient (nil )
97
+ client , err := gh . GQLClient (nil )
97
98
if err != nil {
98
99
log .Fatal (err )
99
100
}
@@ -126,7 +127,7 @@ func ExampleGQLClient_advanced() {
126
127
EnableCache : true ,
127
128
Timeout : 5 * time .Second ,
128
129
}
129
- client , err := GQLClient (& opts )
130
+ client , err := gh . GQLClient (& opts )
130
131
if err != nil {
131
132
log .Fatal (err )
132
133
}
@@ -154,7 +155,7 @@ func ExampleGQLClient_advanced() {
154
155
155
156
// Get repository for the current directory.
156
157
func ExampleCurrentRepository () {
157
- repo , err := CurrentRepository ()
158
+ repo , err := gh . CurrentRepository ()
158
159
if err != nil {
159
160
log .Fatal (err )
160
161
}
0 commit comments