Skip to content

Commit

Permalink
Remove useless func (grafana#472)
Browse files Browse the repository at this point in the history
Remove useless func

No one called this func, keep it only mislead.

Signed-off-by: Xiang Dai <[email protected]>
  • Loading branch information
daixiang0 authored and slim-bean committed Apr 11, 2019
1 parent 638c25f commit b5e632f
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions pkg/promtail/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ package config

import (
"flag"
"io/ioutil"
"path/filepath"

"github.com/weaveworks/common/server"
"gopkg.in/yaml.v2"

"github.com/grafana/loki/pkg/promtail/client"
"github.com/grafana/loki/pkg/promtail/positions"
Expand All @@ -30,18 +27,3 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) {
c.PositionsConfig.RegisterFlags(f)
c.TargetConfig.RegisterFlags(f)
}

// LoadConfig loads config from a file.
func LoadConfig(filename string) (*Config, error) {
buf, err := ioutil.ReadFile(filepath.Clean(filename))
if err != nil {
return nil, err
}

var cfg Config
if err := yaml.UnmarshalStrict(buf, &cfg); err != nil {
return nil, err
}

return &cfg, nil
}

0 comments on commit b5e632f

Please sign in to comment.