Skip to content

Commit a6e79ed

Browse files
authored
Preserve Package (#15)
* preserve package * bump version
1 parent 6651aa2 commit a6e79ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

content_builder.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ func (b *contentBuilder) build(protoFile *descriptorpb.FileDescriptorProto) (str
2929
compVersion := b.request.GetCompilerVersion()
3030
fmt.Fprintf(b.output, "// Code generated by protoc-gen-pubsub-schema. DO NOT EDIT.\n")
3131
fmt.Fprintf(b.output, "// versions:\n")
32-
fmt.Fprintf(b.output, "// protoc-gen-pubsub-schema v1.4.4\n")
32+
fmt.Fprintf(b.output, "// protoc-gen-pubsub-schema v1.5.0\n")
3333
fmt.Fprintf(b.output, "// protoc v%d.%d.%d%s\n", compVersion.GetMajor(), compVersion.GetMinor(), compVersion.GetPatch(), compVersion.GetSuffix())
3434
fmt.Fprintf(b.output, "// source: %s\n\n", protoFile.GetName())
35-
fmt.Fprintf(b.output, "syntax = \"%s\";\n", b.schemaSyntax)
35+
fmt.Fprintf(b.output, "syntax = \"%s\";\n\n", b.schemaSyntax)
36+
fmt.Fprintf(b.output, "package %s;\n", protoFile.GetPackage())
3637
b.buildMessages(protoFile.GetMessageType(), 0)
3738
b.buildEnums(protoFile.GetEnumType(), 0)
3839
return b.output.String(), nil

example/user_add_comment.pps

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Code generated by protoc-gen-pubsub-schema. DO NOT EDIT.
22
// versions:
3-
// protoc-gen-pubsub-schema v1.4.4
3+
// protoc-gen-pubsub-schema v1.5.0
44
// protoc v3.19.1
55
// source: example/user_add_comment.proto
66

77
syntax = "proto2";
88

9+
package example;
10+
911
message UserAddComment {
1012
required User user = 1;
1113
required string comment = 2;

0 commit comments

Comments
 (0)