config: show original input on String()

This commit is contained in:
Fabian Reinartz 2015-06-23 19:40:44 +02:00
parent e18bc94980
commit 7ec15956e4
1 changed files with 2 additions and 3 deletions

View File

@ -24,13 +24,12 @@ var (
// Load parses the YAML input s into a Config.
func Load(s string) (*Config, error) {
cfg := &Config{
original: s,
}
cfg := &Config{}
err := yaml.Unmarshal([]byte(s), cfg)
if err != nil {
return nil, err
}
cfg.original = s
return cfg, nil
}