cfgen/utils.go

21 lines
305 B
Go
Raw Permalink Normal View History

2022-09-18 19:28:34 +02:00
package main
import (
"io"
"os"
)
func ReadFile(path string) ([]byte, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
return io.ReadAll(file)
}
func ReadFileString(path string) (string, error) {
data, err := ReadFile(path)
return string(data), err
}