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 return nil
} }
func Load(path string) (*Directive, error) { func LoadConfig(path string) (*Directive, error) {
f, err := os.Open(path) f, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer f.Close() 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) scanner := bufio.NewScanner(r)
var directives []*Directive var directives []*Directive

View File

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