2024-11-03 00:39:52 -05:00
|
|
|
# You must use the current protoc-gen-go
|
|
|
|
#
|
|
|
|
# go-clone --go-src google.golang.org/protobuf
|
|
|
|
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
# go install
|
|
|
|
|
|
|
|
|
2024-11-15 17:25:11 -06:00
|
|
|
all: package.pb.go
|
2024-11-03 00:39:52 -05:00
|
|
|
make -C example
|
|
|
|
|
|
|
|
vet: lint
|
|
|
|
GO111MODULE=off go vet
|
|
|
|
|
|
|
|
lint:
|
|
|
|
-buf lint git.proto
|
|
|
|
|
|
|
|
# autofixes your import headers in your golang files
|
|
|
|
goimports:
|
|
|
|
goimports -w *.go
|
|
|
|
make -C example goimports
|
|
|
|
|
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
|
|
|
GO111MODULE= go mod init
|
|
|
|
GO111MODULE= go mod tidy
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.pb.go
|
|
|
|
-rm -f go.*
|
|
|
|
make -C example clean
|
|
|
|
|
2024-11-15 17:25:11 -06:00
|
|
|
package.pb.go: package.proto
|
2024-11-03 00:39:52 -05:00
|
|
|
# protoc --go_out=. droplet.proto
|
|
|
|
# This is switched over to use the new protoc-gen-go from google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
# the debian one (2024/10/21) seems to be the older/original one from github.com/golang/protobuf/protoc-gen-go
|
2024-11-15 17:25:11 -06:00
|
|
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/zoopb \
|
|
|
|
--go_opt=Mpackage.proto=go.wit.com/lib/protobuf/zoopb \
|
|
|
|
package.proto
|