Document ToYaml function

reviewable/pr1666/r1
Andrew Stuart 8 years ago
parent ec964ff41d
commit 0474bcbcf1
No known key found for this signature in database
GPG Key ID: D409317C5B5ACD4D

@ -146,6 +146,10 @@ func (f Files) AsSecrets() string {
return ToYaml(m)
}
// ToYaml takes an interface, marshals it to yaml, and returns a string. It will
// always return a string, even on marshal error (empty string).
//
// This is designed to be called from a template.
func ToYaml(v interface{}) string {
data, err := yaml.Marshal(v)
if err != nil {

Loading…
Cancel
Save