示例#1
0
func writeTemplateToFileFrom(url string) func(out *os.File) result_file.Result {
	return func(out *os.File) result_file.Result {
		return result_file.NewResult(
			out,
			fetchTemplate(url).Chain(
				validateResponse,
				copyResponseBodyToOutput(out),
			).Err(),
		)
	}
}
示例#2
0
func openOutputFile() result_file.Result {
	out, err := os.Create("_" + *monad + templateExt)
	return result_file.
		NewResult(out, err).
		Defer(closeOutputFile)
}