Commit 3236ad56
3236ad5686afMerged
Svyatoslav Dumchenko <[email protected]> · 4 years ago · 4 files · +2 added · ~2 modified
Description
Merge pull request #208 from helmwave/tests_template
Add more tests for pkg/template
Details
- Commit
- 3236ad5686af
- Parent
- b52233a2626f
- Merge parent
- 4a1ed2a31839
pkg/template/config.gomodifiedView file
@@ -20,6 +20,14 @@
2020
URL *url.URL2121
}2222
23+
func (s Source) MarshalYAML() (interface{}, error) {24+
type raw struct {25+
URL string26+
}27+
r := raw{URL: s.URL.String()}28+
return r, nil29+
}30+
2331
func (s *Source) UnmarshalYAML(unmarshal func(v interface{}) error) error {2432
type raw struct {2533
URL string@@ -31,13 +39,6 @@
3139
return err3240
}3341
34-
u, err := url.Parse(r.URL)35-
if err != nil {36-
return err37-
}38-
39-
*s = Source{40-
URL: u,41-
}42-
return nil42+
s.URL, err = url.Parse(r.URL)43+
return err4344
}pkg/template/config_test.goaddedView file
Loading diff…
pkg/template/extra_test.goaddedView file
Loading diff…
pkg/template/tpl2yml_test.gomodifiedView file
Loading diff…