Fix: tojson(null) == 'null' (#1068)

* Fix: tojson(null) == 'null'

* Update test

* Update functions_test.go
This commit is contained in:
ChristopherHX
2022-03-22 09:55:13 +01:00
committed by GitHub
parent 87175ecb68
commit 5083284deb
2 changed files with 2 additions and 1 deletions

View File

@@ -151,7 +151,7 @@ func (impl *interperterImpl) join(array reflect.Value, sep reflect.Value) (strin
func (impl *interperterImpl) toJSON(value reflect.Value) (string, error) {
if value.Kind() == reflect.Invalid {
return "", nil
return "null", nil
}
json, err := json.MarshalIndent(value.Interface(), "", " ")