This file contains 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
type App struct { | |
repos repos.Client | |
} |
This file contains 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
// GetReposHandler returns a list of (public) repositories for a given GitHub user | |
func (a *App) GetReposHandler(w http.ResponseWriter, r *http.Request) { | |
user := r.FormValue("user") | |
if user == "" { | |
http.Error(w, "MISSING_ARG_USER", 400) | |
return | |
} | |
repos, err := a.repos.Get(user) | |
if err != nil { |
NewerOlder