2024-05-15 18:49:50 +00:00
|
|
|
/*
|
|
|
|
Copyright © 2024 Brian Buller <brian@bullercodeworks.com>
|
|
|
|
*/
|
2024-05-15 18:42:38 +00:00
|
|
|
package util
|
|
|
|
|
|
|
|
import "io/ioutil"
|
|
|
|
|
|
|
|
func ReadFile(path string) (string, error) {
|
|
|
|
var bytesRead []byte
|
|
|
|
var err error
|
|
|
|
if bytesRead, err = ioutil.ReadFile(path); err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return string(bytesRead), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func WritePWFile(path, contents string) error {
|
|
|
|
return ioutil.WriteFile(path, []byte(contents), 0600)
|
|
|
|
}
|