Remove file

This commit is contained in:
Michael Lindman 2020-02-01 15:41:48 +00:00 committed by GitHub
parent 861a05cc16
commit 965c01365f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
file.go
View File

@ -1,23 +0,0 @@
package request
import (
"io/ioutil"
"log"
"os"
)
// File reads data from file
func File(path string) ([]byte, error) {
file, err := os.Open(path)
if err != nil {
log.Println("Error reading request. ", err)
return nil, err
}
defer file.Close()
byteValue, _ := ioutil.ReadAll(file)
if err != nil {
log.Println(err)
return nil, err
}
return byteValue, nil
}