Skip to content

Commit cbbdbf8

Browse files
committed
refactor: switch to protobuf-go-lite and vtprotobuf-lite
These versions are drastically simpler and do not use reflection. Intended for tinygo support. Library: https://github.com/aperturerobotics/protobuf-go-lite Vtprotobuf: https://github.com/aperturerobotics/vtprotobuf-lite Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent 972e8f4 commit cbbdbf8

File tree

10 files changed

+1217
-1649
lines changed

10 files changed

+1217
-1649
lines changed

Makefile

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
SHELL:=bash
44
PROTOWRAP=hack/bin/protowrap
5-
PROTOC_GEN_GO=hack/bin/protoc-gen-go
5+
PROTOC_GEN_GO=hack/bin/protoc-gen-go-lite
66
PROTOC_GEN_STARPC=hack/bin/protoc-gen-go-starpc
7-
PROTOC_GEN_VTPROTO=hack/bin/protoc-gen-go-vtproto
87
GOIMPORTS=hack/bin/goimports
98
GOFUMPT=hack/bin/gofumpt
109
GOLANGCI_LINT=hack/bin/golangci-lint
@@ -23,14 +22,8 @@ vendor:
2322
$(PROTOC_GEN_GO):
2423
cd ./hack; \
2524
go build -v \
26-
-o ./bin/protoc-gen-go \
27-
google.golang.org/protobuf/cmd/protoc-gen-go
28-
29-
$(PROTOC_GEN_VTPROTO):
30-
cd ./hack; \
31-
go build -v \
32-
-o ./bin/protoc-gen-go-vtproto \
33-
github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto
25+
-o ./bin/protoc-gen-go-lite \
26+
github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite
3427

3528
$(PROTOC_GEN_STARPC):
3629
cd ./hack; \
@@ -69,7 +62,7 @@ $(GO_MOD_OUTDATED):
6962
github.com/psampaz/go-mod-outdated
7063

7164
.PHONY: gengo
72-
gengo: vendor $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_VTPROTO) $(PROTOC_GEN_STARPC)
65+
gengo: vendor $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_STARPC)
7366
shopt -s globstar; \
7467
set -eo pipefail; \
7568
export PROJECT=$$(go list -m); \
@@ -79,9 +72,8 @@ gengo: vendor $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_VTPROTO) $
7972
ln -s $$(pwd) $$(pwd)/vendor/$${PROJECT} ; \
8073
$(PROTOWRAP) \
8174
-I $$(pwd)/vendor \
82-
--go_out=$$(pwd)/vendor \
83-
--go-vtproto_out=$$(pwd)/vendor \
84-
--go-vtproto_opt=features=marshal+unmarshal+size+equal+clone \
75+
--go-lite_out=$$(pwd)/vendor \
76+
--go-lite_opt=features=marshal+unmarshal+size+equal+clone \
8577
--go-starpc_out=$$(pwd)/vendor \
8678
--proto_path $$(pwd)/vendor \
8779
--print_structure \

0 commit comments

Comments
 (0)