refactor(file)

master
Tomas Aparicio 11 years ago
parent e7b430f0d3
commit e7576e085c

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

Loading…
Cancel
Save