Skip to content

Commit 73ba345

Browse files
committed
refactor: split parse and generate stage
1 parent 5ee69f9 commit 73ba345

File tree

14 files changed

+617
-275
lines changed

14 files changed

+617
-275
lines changed

Diff for: README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ func main() {
170170

171171
```sh
172172
protoc \
173-
-I=./examples/normal \
174-
-I=./proto \
175-
--plugin=protoc-gen-debug=$(which protoc-gen-debug) \
176-
--debug_out="./debugdata,lang=go:./debugdata" \
177-
./examples/normal/user.proto
173+
-I=./examples/pb \
174+
-I=./proto \
175+
--plugin=protoc-gen-debug=${debug_path} \
176+
--debug_out="./internal/module/debugdata:." \
177+
./examples/pb/user.proto
178178
```
179179
- debug [Test_ForDebug](./internal/module/fieldmask_test.go#L46) test suite
180180
in [internal/module/fieldmask_test.go](./internal/module/fieldmask_test.go)

Diff for: examples/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ gen-pb:
33
DEBUG_PGFM=1 protoc \
44
-I./pb \
55
-I../proto \
6-
--go_out=paths=source_relative,plugins=grpc:./pb \
6+
--go_out=paths=source_relative:./pb \
77
--fieldmask_out=paths=source_relative,lang=go:./pb \
88
./pb/user.proto

Diff for: examples/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module examples
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/stretchr/testify v1.7.0
7-
github.com/yeqown/protoc-gen-fieldmask v1.0.0
7+
github.com/yeqown/protoc-gen-fieldmask v0.3.5
88
google.golang.org/grpc v1.43.0
99
google.golang.org/protobuf v1.26.0
1010
)
@@ -20,4 +20,4 @@ require (
2020
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
2121
)
2222

23-
replace github.com/yeqown/protoc-gen-fieldmask => ../
23+
replace github.com/yeqown/protoc-gen-fieldmask => ../

Diff for: examples/grpc-masked-response/server.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import (
1111
"examples/pb"
1212
)
1313

14-
type userServer struct{}
14+
type userServer struct {
15+
pb.UnimplementedUserInfoServer
16+
}
1517

1618
func (u userServer) GetUserInfo(
1719
ctx context.Context,

Diff for: examples/pb/user.pb.fm.go

+170-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)