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(), ) } }
func openOutputFile() result_file.Result { out, err := os.Create("_" + *monad + templateExt) return result_file. NewResult(out, err). Defer(closeOutputFile) }