1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

fix: fromJSON should work with any JSON (#883)

* test: fromJSON should work with arrays

* fix: fromJSON should work with any JSON
This commit is contained in:
Mike Beaumont 2021-11-15 15:26:04 +01:00 committed by GitHub
parent 17c788feae
commit 3be0bb5266
2 changed files with 3 additions and 2 deletions

View file

@ -327,8 +327,8 @@ func vmToJSON(vm *otto.Otto) {
}
func vmFromJSON(vm *otto.Otto) {
fromJSON := func(str string) map[string]interface{} {
var dat map[string]interface{}
fromJSON := func(str string) interface{} {
var dat interface{}
err := json.Unmarshal([]byte(str), &dat)
if err != nil {
log.Errorf("Unable to unmarshal: %v", err)