summaryrefslogtreecommitdiff
path: root/xC-gen-proto-go.awk
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-06 17:17:32 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-06 19:41:05 +0200
commit8cd94b30f67f8eacf853fbc77bd60fb57a8262dc (patch)
tree2e4580e9aa0ce6c119741f6e9a2bde2a66d04bf2 /xC-gen-proto-go.awk
parent2d30b6d1154771e194476e136ae341e46f6e08d0 (diff)
downloadxK-8cd94b30f67f8eacf853fbc77bd60fb57a8262dc.tar.gz
xK-8cd94b30f67f8eacf853fbc77bd60fb57a8262dc.tar.xz
xK-8cd94b30f67f8eacf853fbc77bd60fb57a8262dc.zip
xP: implement tab completion
Currently it only goes for the longest common prefix. Refactor WebSocket handling into an abstraction for our protocol. The Go code generater finally needed fixing.
Diffstat (limited to 'xC-gen-proto-go.awk')
-rw-r--r--xC-gen-proto-go.awk3
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 ""