@@ -488,7 +488,7 @@ func Compile(importPath string, files []*ast.File, fileSet *token.FileSet, impor
488
488
pkgPath = method .Pkg ().Path ()
489
489
}
490
490
t := method .Type ().(* types.Signature )
491
- entry := fmt .Sprintf (`{prop: "%s", name: "%s" , pkg: "%s", typ: $funcType(%s)}` , name , method .Name (), pkgPath , c .initArgs (t ))
491
+ entry := fmt .Sprintf (`{prop: "%s", name: %s , pkg: "%s", typ: $funcType(%s)}` , name , encodeString ( method .Name () ), pkgPath , c .initArgs (t ))
492
492
if _ , isPtr := t .Recv ().Type ().(* types.Pointer ); isPtr {
493
493
ptrMethods = append (ptrMethods , entry )
494
494
continue
@@ -589,7 +589,7 @@ func (c *funcContext) initArgs(ty types.Type) string {
589
589
if ! field .Exported () {
590
590
pkgPath = field .Pkg ().Path ()
591
591
}
592
- fields [i ] = fmt .Sprintf (`{prop: "%s", name: "%s" , anonymous: %t, exported: %t, typ: %s, tag: %s}` , fieldName (t , i ), field .Name (), field .Anonymous (), field .Exported (), c .typeName (field .Type ()), encodeString (t .Tag (i )))
592
+ fields [i ] = fmt .Sprintf (`{prop: "%s", name: %s , anonymous: %t, exported: %t, typ: %s, tag: %s}` , fieldName (t , i ), encodeString ( field .Name () ), field .Anonymous (), field .Exported (), c .typeName (field .Type ()), encodeString (t .Tag (i )))
593
593
}
594
594
return fmt .Sprintf (`"%s", [%s]` , pkgPath , strings .Join (fields , ", " ))
595
595
default :
0 commit comments