Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ again.
## Reporting issues

Bugs, feature requests, and development-related questions should be directed to
our [GitHub issue tracker](https://github.com/google/go-github/issues). If
our [GitHub issue tracker](https://github.com/google/go-github/issues). If
reporting a bug, please try and provide as much context as possible such as
your operating system, Go version, and anything else that might be relevant to
the bug. For feature requests, please explain what you're trying to do, and
the bug. For feature requests, please explain what you're trying to do, and
how the requested feature would help you do that.

Security related bugs can either be reported in the issue tracker, or if they
Expand Down Expand Up @@ -163,20 +163,20 @@ Every exported method and type needs to have code comments that follow
//
//meta:operation GET /repos/{owner}/{repo}
func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) {
u := fmt.Sprintf("repos/%v/%v", owner, repo)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
...
u := fmt.Sprintf("repos/%v/%v", owner, repo)
req, err := s.client.NewRequest(ctx, "GET", u, nil)
// ...
}
```
And the returned type `Repository` will have comments like this:

```go
// Repository represents a GitHub repository.
type Repository struct {
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
Owner *User `json:"owner,omitempty"`
...
ID *int64 `json:"id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
Owner *User `json:"owner,omitempty"`
// ...
}
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ is recommended, ex:
```go
import (
"github.com/bartventer/httpcache"
_ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend
_ "github.com/bartventer/httpcache/store/memcache" // Register the in-memory backend
)

client, err := github.NewClient(github.WithHTTPClient(httpcache.NewClient("memcache://")), github.WithAuthToken(os.Getenv("GITHUB_TOKEN")))
Expand Down
14 changes: 7 additions & 7 deletions scrape/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/google/go-github/scrape.svg)](https://pkg.go.dev/github.com/google/go-github/scrape)

The scrape package provides an experimental client for accessing additional
GitHub data via screen scraping. It is designed to be a client of last resort
GitHub data via screen scraping. It is designed to be a client of last resort
for data that cannot be retrieved via the REST or GraphQL APIs.

# What should be added here

**Add only what you need.** Whereas the main go-github library attempts to
**Add only what you need.** Whereas the main go-github library attempts to
implement the entire GitHub REST API, there is little point in trying to do that
here. Certainly, feel free to contribute patches to get data you actually
here. Certainly, feel free to contribute patches to get data you actually
need, but I'd rather not try and provide exhaustive coverage of all GitHub data
here.

**Add only what can't be accessed elsewhere.** If the data can be retrieved
**Add only what can't be accessed elsewhere.** If the data can be retrieved
through the REST or GraphQL API, use the appropriate libraries for that.

**Prefer read-only access.** For now, I'm only focusing on reading data. It
**Prefer read-only access.** For now, I'm only focusing on reading data. It
might be that writing works fine as well, but it is of course much riskier.

# How to add methods

See [apps.go](apps.go) for examples of methods that access data. Basically,
See [apps.go](apps.go) for examples of methods that access data. Basically,
fetch the contents of the page using `client.get`, and then use goquery to dig
into the markup on the page. Prefer selectors that grab semantic ID or class
into the markup on the page. Prefer selectors that grab semantic ID or class
names, as they are more likely to be stable.
Loading