示例#1
0
func copyResponseBodyToOutput(out *os.File) func(resp *http.Response) result_response.Result {
	return func(resp *http.Response) result_response.Result {
		_, err := io.Copy(out, resp.Body)
		return result_response.NewResult(resp, err)
	}
}
示例#2
0
func fetchTemplate(url string) result_response.Result {
	resp, err := http.Get(url)
	return result_response.
		NewResult(resp, err).
		Defer(closeResponseBody)
}