diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-22 23:40:53 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-22 23:40:53 +0200 |
commit | 9280ecb7e0b0039d6c1f4800373eb76452145078 (patch) | |
tree | e3dd11e9953f949709505731a16e8246afe536aa /internal/yaml | |
parent | 15b6c155a8476cf86e8bd745e239e55e77317909 (diff) | |
download | feed2imap-go-9280ecb7e0b0039d6c1f4800373eb76452145078.tar.gz feed2imap-go-9280ecb7e0b0039d6c1f4800373eb76452145078.tar.bz2 feed2imap-go-9280ecb7e0b0039d6c1f4800373eb76452145078.zip |
Concurrent feed processing; central imap handler
Diffstat (limited to '')
-rw-r--r-- | internal/yaml/yaml.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/yaml/yaml.go b/internal/yaml/yaml.go index 207adab..9dc2615 100644 --- a/internal/yaml/yaml.go +++ b/internal/yaml/yaml.go @@ -111,24 +111,24 @@ func buildFeeds(cfg []configGroupFeed, target []string, feeds F.Feeds) error { return nil } -func Load(path string) (C.Config, F.Feeds, error) { +func Load(path string) (*C.Config, F.Feeds, error) { buf, err := ioutil.ReadFile(path) if err != nil { - return C.Config{}, nil, fmt.Errorf("while reading '%s': %w", path, err) + return nil, nil, fmt.Errorf("while reading '%s': %w", path, err) } var parsedCfg config if parsedCfg, err = parse(buf); err != nil { - return C.Config{}, nil, err + return nil, nil, err } feeds := F.Feeds{} if err := buildFeeds(parsedCfg.Feeds, []string{}, feeds); err != nil { - return C.Config{}, nil, fmt.Errorf("while parsing: %w", err) + return nil, nil, fmt.Errorf("while parsing: %w", err) } - return C.Config{ + return &C.Config{ GlobalOptions: parsedCfg.GlobalOptions, GlobalConfig: parsedCfg.GlobalConfig, }, feeds, nil |