-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbasic.go
More file actions
27 lines (21 loc) · 710 Bytes
/
basic.go
File metadata and controls
27 lines (21 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"context"
"fmt"
"github.com/gofri/go-github-ratelimit/v2/github_ratelimit"
"github.com/google/go-github/v69/github"
)
func main() {
// use the plain ratelimiter, without options / callbacks / underlying http.RoundTripper.
rateLimiter := github_ratelimit.NewClient(nil)
client := github.NewClient(rateLimiter) // .WithAuthToken("your personal access token")
// disable go-github's built-in rate limiting
ctx := context.WithValue(context.Background(), github.BypassRateLimitCheck, true)
tags, _, err := client.Repositories.ListTags(ctx, "gofri", "go-github-ratelimit", nil)
if err != nil {
panic(err)
}
for _, tag := range tags {
fmt.Printf("- %v\n", *tag.Name)
}
}