File tree 2 files changed +20
-31
lines changed
2 files changed +20
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // This commands work around namespace conflicts that occur when multiple
2
+ // repositories depend on .proto files with generic filenames. Due to the way
3
+ // protobuf registers files (e.g., foo.proto or pb/foo.proto), naming
4
+ // collisions can occur when the same filename is used across different
5
+ // packages.
6
+ //
7
+ // The only way to generate a *.pb.go file that includes the full package path
8
+ // (e.g., github.com/org/repo/pb/foo.proto) is to place the .proto file in a
9
+ // directory structure that mirrors its package path.
10
+ //
11
+ // References:
12
+ // - https://protobuf.dev/reference/go/faq#namespace-conflict
13
+ // - https://github.com/golang/protobuf/issues/1122#issuecomment-2045945265
14
+ //
15
+ //go:generate mkdir -p github.com/ipfs/boxo/ipns/pb
16
+ //go:generate ln -f record.proto github.com/ipfs/boxo/ipns/pb/
17
+ //go:generate protoc --go_out=. github.com/ipfs/boxo/ipns/pb/record.proto
18
+ //go:generate mv github.com/ipfs/boxo/ipns/pb/record.pb.go .
19
+ //go:generate rm -rf github.com
20
+ package pb
You can’t perform that action at this time.
0 commit comments