diff --git a/config/config.go b/config/config.go index 75534dcd0..6cf142d66 100644 --- a/config/config.go +++ b/config/config.go @@ -3,6 +3,7 @@ package config import ( + "io" "io/ioutil" yaml "gopkg.in/yaml.v1" @@ -116,3 +117,13 @@ func Load(file string) (config Project, err error) { err = yaml.Unmarshal(data, &config) return } + +// Load config via io.Reader +func LoadReader(fd io.Reader) (config Project, err error) { + data, err := ioutil.ReadAll(fd) + if err != nil { + return config, err + } + err = yaml.Unmarshal(data, &config) + return +}