From 6608aaf8650abcd3cdf120213f4b4ff849229662 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 10 Sep 2020 14:35:41 +0200 Subject: [PATCH] Rename Parse and Load to {Parse,Load}Config --- config.go | 6 +++--- main.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 582b74e..24996c0 100644 --- a/config.go +++ b/config.go @@ -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 diff --git a/main.go b/main.go index 82750ab..caf9937 100644 --- a/main.go +++ b/main.go @@ -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) }