MCPcopy Index your code
hub / github.com/google/go-github / ExampleRepositoriesService_ListByUser

Function ExampleRepositoriesService_ListByUser

github/examples_test.go:56–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56func ExampleRepositoriesService_ListByUser() {
57 client, err := github.NewClient()
58 if err != nil {
59 log.Fatalf("Error creating GitHub client: %v", err)
60 }
61
62 user := "willnorris"
63 opt := &github.RepositoryListByUserOptions{Type: "owner", Sort: "updated", Direction: "desc"}
64
65 ctx := context.Background()
66 repos, _, err := client.Repositories.ListByUser(ctx, user, opt)
67 if err != nil {
68 log.Fatalf("error listing repositories by user: %v", err)
69 }
70
71 fmt.Printf("Recently updated repositories by %q: %v", user, github.Stringify(repos))
72}
73
74func ExampleRepositoriesService_CreateFile() {
75 // In this example we're creating a new file in a repository using the

Callers

nothing calls this directly

Calls 3

NewClientFunction · 0.92
StringifyFunction · 0.92
ListByUserMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…