Skip to content

Commit

Permalink
change Change example_gh_test.go to package gh_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mntlty committed Nov 4, 2022
1 parent e3ec45f commit 114787b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions example_gh_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gh
package gh_test

import (
"fmt"
Expand All @@ -7,6 +7,7 @@ import (
"os"
"time"

gh "github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
Expand All @@ -16,7 +17,7 @@ import (
// Execute 'gh issue list -R cli/cli', and print the output.
func ExampleExec() {
args := []string{"issue", "list", "-R", "cli/cli"}
stdOut, stdErr, err := Exec(args...)
stdOut, stdErr, err := gh.Exec(args...)
if err != nil {
log.Fatal(err)
}
Expand All @@ -26,7 +27,7 @@ func ExampleExec() {

// Get tags from cli/cli repository using REST API.
func ExampleRESTClient_simple() {
client, err := RESTClient(nil)
client, err := gh.RESTClient(nil)
if err != nil {
log.Fatal(err)
}
Expand All @@ -47,7 +48,7 @@ func ExampleRESTClient_advanced() {
Headers: map[string]string{"Time-Zone": "America/Los_Angeles"},
Log: os.Stdout,
}
client, err := RESTClient(&opts)
client, err := gh.RESTClient(&opts)
if err != nil {
log.Fatal(err)
}
Expand All @@ -64,7 +65,7 @@ func ExampleRESTClient_request() {
opts := api.ClientOptions{
Headers: map[string]string{"Accept": "application/octet-stream"},
}
client, err := RESTClient(&opts)
client, err := gh.RESTClient(&opts)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -93,7 +94,7 @@ func ExampleRESTClient_request() {

// Query tags from cli/cli repository using GQL API.
func ExampleGQLClient_simple() {
client, err := GQLClient(nil)
client, err := gh.GQLClient(nil)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -126,7 +127,7 @@ func ExampleGQLClient_advanced() {
EnableCache: true,
Timeout: 5 * time.Second,
}
client, err := GQLClient(&opts)
client, err := gh.GQLClient(&opts)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -154,7 +155,7 @@ func ExampleGQLClient_advanced() {

// Get repository for the current directory.
func ExampleCurrentRepository() {
repo, err := CurrentRepository()
repo, err := gh.CurrentRepository()
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 114787b

Please sign in to comment.