mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-07 22:35:37 +00:00
Stop treating top-level values specially
This commit is contained in:
parent
b6da773dde
commit
a865d66b4f
5
yq.go
5
yq.go
@ -600,13 +600,8 @@ func toString(context interface{}) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func yamlToString(context interface{}) (string, error) {
|
func yamlToString(context interface{}) (string, error) {
|
||||||
switch context := context.(type) {
|
|
||||||
case string:
|
|
||||||
return context, nil
|
|
||||||
default:
|
|
||||||
return marshalContext(context)
|
return marshalContext(context)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func marshalContext(context interface{}) (string, error) {
|
func marshalContext(context interface{}) (string, error) {
|
||||||
out, err := yaml.Marshal(context)
|
out, err := yaml.Marshal(context)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user