local-server/utils.go
2018-06-12 21:09:47 +11:00

19 lines
206 B
Go

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
}