Created
September 15, 2016 03:58
-
-
Save chazcheadle/00b2746eeb21265c8c24e8f51aecc938 to your computer and use it in GitHub Desktop.
Golang go-github example to list a user's public repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "github.com/google/go-github/github" | |
| ) | |
| func main() { | |
| var user string | |
| user = "chazcheadle" | |
| client := github.NewClient(nil) | |
| opt := &github.RepositoryListOptions{Type: "owner"} | |
| repos, _, err := client.Repositories.List(user, opt) | |
| if err != nil { | |
| fmt.Println("Error retrieving repositories for %s", user) | |
| } | |
| fmt.Println("%v", repos) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment