mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-29 01:11:02 +02:00
builtins.go: fix builtinManifestJSONEx regression
This commit fixes a regression in std.manifestJsonEx that caused the standard library function to error when the given value was an array. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
parent
f742f2463e
commit
5d0f3fb5ed
@ -1211,10 +1211,7 @@ func jsonEncode(v interface{}) (string, error) {
|
|||||||
// For backwards compatibility reasons, we are manually marshalling to json so we can control formatting
|
// For backwards compatibility reasons, we are manually marshalling to json so we can control formatting
|
||||||
// In the future, it might be apt to use a library [pretty-printing] function
|
// In the future, it might be apt to use a library [pretty-printing] function
|
||||||
func builtinManifestJSONEx(i *interpreter, arguments []value) (value, error) {
|
func builtinManifestJSONEx(i *interpreter, arguments []value) (value, error) {
|
||||||
obj, err := i.getObject(arguments[0])
|
val := arguments[0]
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
vindent, err := i.getString(arguments[1])
|
vindent, err := i.getString(arguments[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1315,7 +1312,7 @@ func builtinManifestJSONEx(i *interpreter, arguments []value) (value, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finalString, err := aux(obj, path, "")
|
finalString, err := aux(val, path, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user