removed file
Signed-off-by: Michael <michael.lindman@gmail.com>
This commit is contained in:
parent
861a05cc16
commit
e99a4742bb
23
file.go
23
file.go
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user