refactor(file)

This commit is contained in:
Tomas Aparicio 2015-04-12 17:43:11 +02:00
parent e7b430f0d3
commit e7576e085c

18
file.go
View file

@ -1,23 +1,9 @@
package bimg
import (
"io/ioutil"
"os"
)
import "io/ioutil"
func Read(path string) ([]byte, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
buf, err := ioutil.ReadAll(file)
if err != nil {
return nil, err
}
return buf, nil
return ioutil.ReadFile(path)
}
func Write(path string, buf []byte) error {