From 8cd94b30f67f8eacf853fbc77bd60fb57a8262dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Tue, 6 Sep 2022 17:17:32 +0200 Subject: 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. --- xC-gen-proto-go.awk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xC-gen-proto-go.awk') 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 "" -- cgit v1.2.3