Fetch all the public organizations' membership of a user.
(username string)
| 18 | |
| 19 | // Fetch all the public organizations' membership of a user. |
| 20 | func fetchOrganizations(username string) ([]*github.Organization, error) { |
| 21 | client, err := github.NewClient() |
| 22 | if err != nil { |
| 23 | return nil, err |
| 24 | } |
| 25 | orgs, _, err := client.Organizations.List(context.Background(), username, nil) |
| 26 | return orgs, err |
| 27 | } |
| 28 | |
| 29 | func main() { |
| 30 | var username string |