Maint: split custom config files in openvpn/custom

This commit is contained in:
Quentin McGaw (desktop)
2021-08-18 20:18:49 +00:00
parent 996942af47
commit df51aa40f4
10 changed files with 624 additions and 562 deletions

View File

@@ -0,0 +1,27 @@
package custom
import (
"io"
"os"
"strings"
)
func readCustomConfigLines(filepath string) (
lines []string, err error) {
file, err := os.Open(filepath)
if err != nil {
return nil, err
}
b, err := io.ReadAll(file)
if err != nil {
_ = file.Close()
return nil, err
}
if err := file.Close(); err != nil {
return nil, err
}
return strings.Split(string(b), "\n"), nil
}