diff options
Diffstat (limited to 'xC-gen-proto-go.awk')
| -rw-r--r-- | xC-gen-proto-go.awk | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/xC-gen-proto-go.awk b/xC-gen-proto-go.awk index 1880de7..1a64eb8 100644 --- a/xC-gen-proto-go.awk +++ b/xC-gen-proto-go.awk @@ -382,7 +382,8 @@ function codegen_union(name, cg,    gotype, tagfield, tagvar) {  	print "}"  	print "" -	print "func (u *" gotype ") MarshalJSON() ([]byte, error) {" +	# This cannot be a pointer method, it wouldn't work recursively. +	print "func (u " gotype ") MarshalJSON() ([]byte, error) {"  	print "\treturn json.Marshal(u.Interface)"  	print "}"  	print "" | 
