func (i *IssueServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { issues, err := github.SearchIssues(i.terms) if err != nil { log.Print(err) } if err := i.tmpl.Execute(w, issues); err != nil { log.Print(err) } }
func main() { issues, err := github.SearchIssues(os.Args[1:]) if err != nil { log.Fatal(err) } if err := html.Execute(os.Stdout, issues); err != nil { log.Fatal(err) } }
func main() { result, err := github.SearchIssues(os.Args[1:]) if err != nil { log.Fatal(err) } if err := report.Execute(os.Stdout, result); err != nil { log.Fatal(err) } }
func main() { result, err := github.SearchIssues(os.Args[1:]) if err != nil { log.Fatal(err) } fmt.Printf("%d issues:\n", result.TotalCount) for _, issue := range result.Items { var a ageReport = ageReport(time.Since(issue.CreatedAt)) fmt.Printf("#%-5d|%9s|%9.9s|%.55s\n", issue.Number, a, issue.User.Login, issue.Title) } }