blob: 6314756f6b9ef2dd8d7adc328b0816e3a07bc012 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package compat
import (
"io"
"net/http"
"os"
)
func SaveFromBody(f *os.File, r *http.Request) error {
if _, err := io.Copy(f, r.Body); err != nil {
return err
}
return f.Close()
}
|