Skip to content

no more generated package doc #528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions _conformance/conformance.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions _conformance/conformance_proto/conformance.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 0 additions & 27 deletions jsonpb/jsonpb_test_proto/more_test_objects.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 0 additions & 39 deletions proto/test_proto/test.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 0 additions & 39 deletions proto/test_proto/test.pb.go.golden
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: test.proto

/*
Package test_proto is a generated protocol buffer package.

It is generated from these files:
test.proto

It has these top-level messages:
GoEnum
GoTestField
GoTest
GoTestRequiredGroupField
GoSkipTest
NonPackedTest
PackedTest
MaxTag
OldMessage
NewMessage
InnerMessage
OtherMessage
RequiredInnerMessage
MyMessage
Ext
ComplexExtension
DefaultsMessage
MyMessageSet
Empty
MessageList
Strings
Defaults
SubDefaults
RepeatedEnum
MoreRepeated
GroupOld
GroupNew
FloatingPoint
MessageWithMap
Oneof
Communique
*/
package test_proto

import proto "github.com/golang/protobuf/proto"
Expand Down
45 changes: 12 additions & 33 deletions protoc-gen-go/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1339,43 +1339,22 @@ func (g *Generator) generateHeader() {

name := g.file.PackageName()

if g.file.index == 0 {
// Generate package docs for the first file in the package.
g.P("package ", name)
g.P()

if loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok {
g.P("/*")
g.P("Package ", name, " is a generated protocol buffer package.")
g.P()
if loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok {
// not using g.PrintComments because this is a /* */ comment block.
text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
for _, line := range strings.Split(text, "\n") {
line = strings.TrimPrefix(line, " ")
// ensure we don't escape from the block comment
line = strings.Replace(line, "*/", "* /", -1)
g.P(line)
}
g.P()
}
var topMsgs []string
g.P("It is generated from these files:")
for _, f := range g.genFiles {
g.P("\t", f.Name)
for _, msg := range f.desc {
if msg.parent != nil {
continue
}
topMsgs = append(topMsgs, CamelCaseSlice(msg.TypeName()))
}
}
g.P()
g.P("It has these top-level messages:")
for _, msg := range topMsgs {
g.P("\t", msg)
// not using g.PrintComments because this is a /* */ comment block.
text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
for _, line := range strings.Split(text, "\n") {
line = strings.TrimPrefix(line, " ")
// ensure we don't escape from the block comment
line = strings.Replace(line, "*/", "* /", -1)
g.P(line)
}
g.P("*/")
g.P()
}

g.P("package ", name)
g.P()
}

// deprecationComment is the standard comment added to deprecated
Expand Down
12 changes: 2 additions & 10 deletions protoc-gen-go/testdata/deprecated/deprecated.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions protoc-gen-go/testdata/extension_base/extension_base.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions protoc-gen-go/testdata/extension_extra/extension_extra.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions protoc-gen-go/testdata/extension_user/extension_user.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions protoc-gen-go/testdata/grpc/grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions protoc-gen-go/testdata/imp/imp.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions protoc-gen-go/testdata/multi/multi1.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 2 additions & 15 deletions protoc-gen-go/testdata/my_test/test.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading