37 lines
759 B
Makefile
37 lines
759 B
Makefile
|
# 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
|
||
|
|
||
|
|
||
|
all: repo.pb.go
|
||
|
make -C example
|
||
|
|
||
|
vet: lint
|
||
|
GO111MODULE=off go vet
|
||
|
|
||
|
lint:
|
||
|
-buf lint repo.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
|
||
|
|
||
|
repo.pb.go: repo.proto
|
||
|
# I'm using version v1.35.x from google.golang.org/protobuf/cmd/protoc-gen-go
|
||
|
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/forgepb \
|
||
|
--go_opt=Mrepo.proto=go.wit.com/lib/protobuf/forgepb \
|
||
|
repo.proto
|