Skip to content

Instantly share code, notes, and snippets.

@antklim
Last active November 19, 2020 03:34
Show Gist options
  • Select an option

  • Save antklim/425e34027477dc33cf3633b610a8179b to your computer and use it in GitHub Desktop.

Select an option

Save antklim/425e34027477dc33cf3633b610a8179b to your computer and use it in GitHub Desktop.
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}
func Routes(client HTTPClient) map[string]http.HandlerFunc {
return map[string]http.HandlerFunc{
"/do": doHandler(),
"/remote": remoteHandler(client),
"/": notFoundHandler,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment