Skip to content
Permalink
Browse files

cmd/shfmt: remove StmtList case from -json

Luckily, we got rid of that node type, so we can get rid of this hack.
  • Loading branch information...
mvdan committed Jun 2, 2019
1 parent 9162b76 commit c578c6ff3564d60fe40574d0a25bda2edf5dbfb6
Showing with 1 addition and 9 deletions.
  1. +1 −9 cmd/shfmt/json.go
@@ -51,15 +51,7 @@ func recurse(val, valPtr reflect.Value) (interface{}, string) {
}
fval := val.Field(i)
v, _ := recurse(fval, fval)
switch ftyp.Name {
case "StmtList":
// inline their fields
for name, v := range v.(map[string]interface{}) {
m[name] = v
}
default:
m[ftyp.Name] = v
}
m[ftyp.Name] = v
}
// use valPtr to find the method, as methods are defined on the
// pointer values.

0 comments on commit c578c6f

Please sign in to comment.
You can’t perform that action at this time.