Skip to content

Commit aa26184

Browse files
committed
Rename CurrentRepository to Current
1 parent 53b6eb1 commit aa26184

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Modules from this library will obey GitHub CLI conventions by default:
66

7-
- [`CurrentRepository()`](https://pkg.go.dev/github.com/cli/go-gh#CurrentRepository) respects the value of the `GH_REPO` environment variable and reads from git remote configuration as fallback.
7+
- [`repository.Current()`](https://pkg.go.dev/github.com/cli/go-gh/pkg/repository#current) respects the value of the `GH_REPO` environment variable and reads from git remote configuration as fallback.
88

99
- GitHub API requests will be authenticated using the same mechanism as `gh`, i.e. using the values of `GH_TOKEN` and `GH_HOST` environment variables and falling back to the user's stored OAuth token.
1010

@@ -36,7 +36,7 @@ func main() {
3636
log.Fatal(err)
3737
}
3838
fmt.Println(issueList.String())
39-
39+
4040
// Use an API helper to grab repository tags
4141
client, err := gh.RESTClient(nil)
4242
if err != nil {
@@ -59,7 +59,6 @@ See [examples][] for more demonstrations of usage.
5959

6060
If anything feels off, or if you feel that some functionality is missing, please check out our [contributing docs][contributing]. There you will find instructions for sharing your feedback and for submitting pull requests to the project. Thank you!
6161

62-
6362
[extensions]: https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions
6463
[examples]: ./example_gh_test.go
6564
[contributing]: ./.github/CONTRIBUTING.md

example_gh_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ func ExampleGQLClient_pagination() {
269269
}
270270

271271
// Get repository for the current directory.
272-
func ExampleCurrentRepository() {
273-
repo, err := repository.CurrentRepository()
272+
func ExampleCurrent() {
273+
repo, err := repository.Current()
274274
if err != nil {
275275
log.Fatal(err)
276276
}

pkg/repository/repository.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ func ParseWithHost(s, host string) (Repository, error) {
114114
}
115115
}
116116

117-
// CurrentRepository uses git remotes to determine the GitHub repository
117+
// Current uses git remotes to determine the GitHub repository
118118
// the current directory is tracking.
119-
func CurrentRepository() (Repository, error) {
119+
func Current() (Repository, error) {
120120
var r Repository
121121

122122
override := os.Getenv("GH_REPO")

0 commit comments

Comments
 (0)