1
1
Fork 0
mirror of https://git.sr.ht/~emersion/tlstunnel synced 2024-05-11 13:46:03 +02:00

Rename Parse and Load to {Parse,Load}Config

This commit is contained in:
Simon Ser 2020-09-10 14:35:41 +02:00
parent 0dd852183a
commit 6608aaf865
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 4 additions and 4 deletions

View File

@ -47,17 +47,17 @@ func (d *Directive) ChildByName(name string) *Directive {
return nil
}
func Load(path string) (*Directive, error) {
func LoadConfig(path string) (*Directive, error) {
f, err := os.Open(path)
if err != nil {
return nil, err
}
defer f.Close()
return Parse(f)
return ParseConfig(f)
}
func Parse(r io.Reader) (*Directive, error) {
func ParseConfig(r io.Reader) (*Directive, error) {
scanner := bufio.NewScanner(r)
var directives []*Directive

View File

@ -15,7 +15,7 @@ func main() {
flag.StringVar(&configPath, "config", configPath, "path to configuration file")
flag.Parse()
cfg, err := Load(configPath)
cfg, err := LoadConfig(configPath)
if err != nil {
log.Fatalf("failed to load config file: %v", err)
}