local-server/utils.go

19 lines
206 B
Go
Raw Normal View History

2018-06-12 10:09:47 +00:00
package main
import (
"io"
"os"
)
func writeFile(out io.Writer, path string) error {
f, err := os.Open(path)
if err != nil {
return err
}
defer f.Close()
_, err = io.Copy(out, f)
return err
}