-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEP-25: Implementation of toYaml function. (#1375)
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package renderer | ||
|
||
import "gopkg.in/yaml.v2" | ||
|
||
// ToYaml takes any value, and returns its YAML representation as a string. | ||
func ToYaml(v interface{}) (string, error) { | ||
out, err := yaml.Marshal(v) | ||
return string(out), err | ||
} |