internal/descfmt: rename from typefmt
The name descfmt more closely matches the fact that this package
provides pretty-printing for descriptors.
Change-Id: I11b0e4a0302962ee7bbf315fb259d050847cadbb
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/178479
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/cmd/generate-types/main.go b/internal/cmd/generate-types/main.go
index c851062..66a852d 100644
--- a/internal/cmd/generate-types/main.go
+++ b/internal/cmd/generate-types/main.go
@@ -193,7 +193,7 @@
return {{$nameDesc}}{t}
}
{{- end}}
- func (p *{{$nameList}}) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+ func (p *{{$nameList}}) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *{{$nameList}}) ProtoInternal(pragma.DoNotImplement) {}
{{- end}}
`))
@@ -262,7 +262,7 @@
}
{{- end}}
func (p *{{$nameList}}) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *{{$nameList}}) ProtoInternal(pragma.DoNotImplement) {}
func (p *{{$nameList}}) lazyInit() *{{$nameList}} {
@@ -316,10 +316,10 @@
"sync",
"unicode/utf8",
"",
+ "google.golang.org/protobuf/internal/descfmt",
"google.golang.org/protobuf/internal/encoding/wire",
"google.golang.org/protobuf/internal/errors",
"google.golang.org/protobuf/internal/pragma",
- "google.golang.org/protobuf/internal/typefmt",
"google.golang.org/protobuf/reflect/protoreflect",
"google.golang.org/protobuf/runtime/protoiface",
} {
diff --git a/internal/typefmt/desc_test.go b/internal/descfmt/desc_test.go
similarity index 98%
rename from internal/typefmt/desc_test.go
rename to internal/descfmt/desc_test.go
index ab3f9b4..07c452b 100644
--- a/internal/typefmt/desc_test.go
+++ b/internal/descfmt/desc_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package typefmt
+package descfmt
import (
"testing"
diff --git a/internal/typefmt/stringer.go b/internal/descfmt/stringer.go
similarity index 98%
rename from internal/typefmt/stringer.go
rename to internal/descfmt/stringer.go
index 6c61f32..a6d33c0 100644
--- a/internal/typefmt/stringer.go
+++ b/internal/descfmt/stringer.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package typefmt provides functionality to format descriptors.
-package typefmt
+// Package descfmt provides functionality to format descriptors.
+package descfmt
import (
"fmt"
diff --git a/internal/fileinit/desc.go b/internal/fileinit/desc.go
index a341d3c..0804bf8 100644
--- a/internal/fileinit/desc.go
+++ b/internal/fileinit/desc.go
@@ -13,10 +13,10 @@
"reflect"
"sync"
- descopts "google.golang.org/protobuf/internal/descopts"
+ "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/descopts"
pimpl "google.golang.org/protobuf/internal/impl"
- pragma "google.golang.org/protobuf/internal/pragma"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/pragma"
"google.golang.org/protobuf/proto"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
@@ -267,7 +267,7 @@
func (fd *fileDesc) Messages() pref.MessageDescriptors { return &fd.messages }
func (fd *fileDesc) Extensions() pref.ExtensionDescriptors { return &fd.extensions }
func (fd *fileDesc) Services() pref.ServiceDescriptors { return &fd.services }
-func (fd *fileDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, fd) }
+func (fd *fileDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
func (fd *fileDesc) ProtoType(pref.FileDescriptor) {}
func (fd *fileDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -312,7 +312,7 @@
func (ed *enumDesc) Values() pref.EnumValueDescriptors { return &ed.lazyInit().values }
func (ed *enumDesc) ReservedNames() pref.Names { return &ed.lazyInit().resvNames }
func (ed *enumDesc) ReservedRanges() pref.EnumRanges { return &ed.lazyInit().resvRanges }
-func (ed *enumDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, ed) }
+func (ed *enumDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
func (ed *enumDesc) ProtoType(pref.EnumDescriptor) {}
func (ed *enumDesc) lazyInit() *enumLazy {
ed.parentFile.lazyInit() // implicitly initializes enumLazy
@@ -323,7 +323,7 @@
return unmarshalOptions(descopts.EnumValue, ed.options)
}
func (ed *enumValueDesc) Number() pref.EnumNumber { return ed.number }
-func (ed *enumValueDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, ed) }
+func (ed *enumValueDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
func (ed *enumValueDesc) ProtoType(pref.EnumValueDescriptor) {}
type (
@@ -399,7 +399,7 @@
func (md *messageDesc) Messages() pref.MessageDescriptors { return &md.messages }
func (md *messageDesc) Extensions() pref.ExtensionDescriptors { return &md.extensions }
func (md *messageDesc) ProtoType(pref.MessageDescriptor) {}
-func (md *messageDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, md.asDesc()) }
+func (md *messageDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md.asDesc()) }
func (md *messageDesc) lazyInit() *messageLazy {
md.parentFile.lazyInit() // implicitly initializes messageLazy
return md.lazy
@@ -462,7 +462,7 @@
}
func (fd *fieldDesc) Enum() pref.EnumDescriptor { return fd.enumType }
func (fd *fieldDesc) Message() pref.MessageDescriptor { return fd.messageType }
-func (fd *fieldDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, fd) }
+func (fd *fieldDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
func (fd *fieldDesc) ProtoType(pref.FieldDescriptor) {}
// TODO: Remove this.
@@ -473,7 +473,7 @@
return unmarshalOptions(descopts.Oneof, od.options)
}
func (od *oneofDesc) Fields() pref.FieldDescriptors { return &od.fields }
-func (od *oneofDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, od) }
+func (od *oneofDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, od) }
func (od *oneofDesc) ProtoType(pref.OneofDescriptor) {}
type (
@@ -538,7 +538,7 @@
func (xd *extensionDesc) ContainingMessage() pref.MessageDescriptor { return xd.extendedType }
func (xd *extensionDesc) Enum() pref.EnumDescriptor { return xd.lazyInit().enumType }
func (xd *extensionDesc) Message() pref.MessageDescriptor { return xd.lazyInit().messageType }
-func (xd *extensionDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, xd) }
+func (xd *extensionDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, xd) }
func (xd *extensionDesc) ProtoType(pref.FieldDescriptor) {}
func (xd *extensionDesc) ProtoInternal(pragma.DoNotImplement) {}
func (xd *extensionDesc) lazyInit() *extensionLazy {
@@ -584,7 +584,7 @@
return unmarshalOptions(descopts.Service, sd.lazyInit().options)
}
func (sd *serviceDesc) Methods() pref.MethodDescriptors { return &sd.lazyInit().methods }
-func (sd *serviceDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, sd) }
+func (sd *serviceDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, sd) }
func (sd *serviceDesc) ProtoType(pref.ServiceDescriptor) {}
func (sd *serviceDesc) ProtoInternal(pragma.DoNotImplement) {}
func (sd *serviceDesc) lazyInit() *serviceLazy {
@@ -599,7 +599,7 @@
func (md *methodDesc) Output() pref.MessageDescriptor { return md.outputType }
func (md *methodDesc) IsStreamingClient() bool { return md.isStreamingClient }
func (md *methodDesc) IsStreamingServer() bool { return md.isStreamingServer }
-func (md *methodDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, md) }
+func (md *methodDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) }
func (md *methodDesc) ProtoType(pref.MethodDescriptor) {}
func (md *methodDesc) ProtoInternal(pragma.DoNotImplement) {}
diff --git a/internal/fileinit/desc_list.go b/internal/fileinit/desc_list.go
index 5f3443f..8ff600b 100644
--- a/internal/fileinit/desc_list.go
+++ b/internal/fileinit/desc_list.go
@@ -9,8 +9,8 @@
"sort"
"sync"
- pragma "google.golang.org/protobuf/internal/pragma"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/pragma"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -18,7 +18,7 @@
func (p *fileImports) Len() int { return len(*p) }
func (p *fileImports) Get(i int) pref.FileImport { return (*p)[i] }
-func (p *fileImports) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *fileImports) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fileImports) ProtoInternal(pragma.DoNotImplement) {}
type names struct {
@@ -41,7 +41,7 @@
_, ok := p.has[s]
return ok
}
-func (p *names) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *names) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *names) ProtoInternal(pragma.DoNotImplement) {}
type enumRanges struct {
@@ -85,7 +85,7 @@
}
return false
}
-func (p *enumRanges) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *enumRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *enumRanges) ProtoInternal(pragma.DoNotImplement) {}
type fieldRanges struct {
@@ -129,7 +129,7 @@
}
return false
}
-func (p *fieldRanges) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *fieldRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fieldRanges) ProtoInternal(pragma.DoNotImplement) {}
type fieldNumbers struct {
@@ -152,7 +152,7 @@
_, ok := p.has[n]
return ok
}
-func (p *fieldNumbers) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *fieldNumbers) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fieldNumbers) ProtoInternal(pragma.DoNotImplement) {}
type oneofFields struct {
@@ -168,7 +168,7 @@
func (p *oneofFields) ByName(s pref.Name) pref.FieldDescriptor { return p.lazyInit().byName[s] }
func (p *oneofFields) ByJSONName(s string) pref.FieldDescriptor { return p.lazyInit().byJSON[s] }
func (p *oneofFields) ByNumber(n pref.FieldNumber) pref.FieldDescriptor { return p.lazyInit().byNum[n] }
-func (p *oneofFields) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *oneofFields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *oneofFields) ProtoInternal(pragma.DoNotImplement) {}
func (p *oneofFields) lazyInit() *oneofFields {
diff --git a/internal/fileinit/desc_list_gen.go b/internal/fileinit/desc_list_gen.go
index 4018c9b..90cc5ae 100644
--- a/internal/fileinit/desc_list_gen.go
+++ b/internal/fileinit/desc_list_gen.go
@@ -10,8 +10,8 @@
"fmt"
"sync"
+ "google.golang.org/protobuf/internal/descfmt"
"google.golang.org/protobuf/internal/pragma"
- "google.golang.org/protobuf/internal/typefmt"
"google.golang.org/protobuf/reflect/protoreflect"
)
@@ -34,7 +34,7 @@
return nil
}
func (p *enumDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *enumDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *enumDescs) lazyInit() *enumDescs {
@@ -78,7 +78,7 @@
return nil
}
func (p *enumValueDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *enumValueDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *enumValueDescs) lazyInit() *enumValueDescs {
@@ -119,7 +119,7 @@
return nil
}
func (p *messageDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *messageDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *messageDescs) lazyInit() *messageDescs {
@@ -170,7 +170,7 @@
return nil
}
func (p *fieldDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *fieldDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *fieldDescs) lazyInit() *fieldDescs {
@@ -215,7 +215,7 @@
return nil
}
func (p *oneofDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *oneofDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *oneofDescs) lazyInit() *oneofDescs {
@@ -252,7 +252,7 @@
return nil
}
func (p *extensionDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *extensionDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *extensionDescs) lazyInit() *extensionDescs {
@@ -289,7 +289,7 @@
return nil
}
func (p *serviceDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *serviceDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *serviceDescs) lazyInit() *serviceDescs {
@@ -326,7 +326,7 @@
return nil
}
func (p *methodDescs) Format(s fmt.State, r rune) {
- typefmt.FormatList(s, r, p)
+ descfmt.FormatList(s, r, p)
}
func (p *methodDescs) ProtoInternal(pragma.DoNotImplement) {}
func (p *methodDescs) lazyInit() *methodDescs {
diff --git a/internal/legacy/extension.go b/internal/legacy/extension.go
index 216cb4e..1f53f1b 100644
--- a/internal/legacy/extension.go
+++ b/internal/legacy/extension.go
@@ -9,10 +9,10 @@
"reflect"
"sync"
+ "google.golang.org/protobuf/internal/descfmt"
ptag "google.golang.org/protobuf/internal/encoding/tag"
pimpl "google.golang.org/protobuf/internal/impl"
ptype "google.golang.org/protobuf/internal/prototype"
- pfmt "google.golang.org/protobuf/internal/typefmt"
pvalue "google.golang.org/protobuf/internal/value"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
@@ -276,4 +276,4 @@
func (x *extensionType) New() pref.Value { return x.new() }
func (x *extensionType) ValueOf(v interface{}) pref.Value { return x.valueOf(v) }
func (x *extensionType) InterfaceOf(v pref.Value) interface{} { return x.interfaceOf(v) }
-func (x *extensionType) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, x.Descriptor()) }
+func (x *extensionType) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, x.Descriptor()) }
diff --git a/internal/prototype/go_type.go b/internal/prototype/go_type.go
index bf7977f..16b49dc 100644
--- a/internal/prototype/go_type.go
+++ b/internal/prototype/go_type.go
@@ -9,7 +9,7 @@
"reflect"
"sync"
- "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/descfmt"
"google.golang.org/protobuf/internal/value"
"google.golang.org/protobuf/reflect/protoreflect"
)
@@ -47,7 +47,7 @@
return e
}
func (t *goEnum) Format(s fmt.State, r rune) {
- typefmt.FormatDesc(s, r, t)
+ descfmt.FormatDesc(s, r, t)
}
// GoMessage creates a new protoreflect.MessageType by combining the provided
@@ -86,7 +86,7 @@
return m
}
func (t *goMessage) Format(s fmt.State, r rune) {
- typefmt.FormatDesc(s, r, t)
+ descfmt.FormatDesc(s, r, t)
}
// GoExtension creates a new protoreflect.ExtensionType.
@@ -212,7 +212,7 @@
return v
}
func (t *goExtension) Format(s fmt.State, r rune) {
- typefmt.FormatDesc(s, r, t)
+ descfmt.FormatDesc(s, r, t)
}
func (t *goExtension) lazyInit() {
t.once.Do(func() {
diff --git a/internal/prototype/placeholder_type.go b/internal/prototype/placeholder_type.go
index 53d5e24..c7a82c2 100644
--- a/internal/prototype/placeholder_type.go
+++ b/internal/prototype/placeholder_type.go
@@ -7,9 +7,9 @@
import (
"fmt"
- descopts "google.golang.org/protobuf/internal/descopts"
- pragma "google.golang.org/protobuf/internal/pragma"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ descfmt "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/descopts"
+ "google.golang.org/protobuf/internal/pragma"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -53,7 +53,7 @@
func (t placeholderFile) Messages() pref.MessageDescriptors { return &emptyMessages }
func (t placeholderFile) Extensions() pref.ExtensionDescriptors { return &emptyExtensions }
func (t placeholderFile) Services() pref.ServiceDescriptors { return &emptyServices }
-func (t placeholderFile) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t placeholderFile) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t placeholderFile) ProtoType(pref.FileDescriptor) {}
type placeholderMessage struct {
@@ -72,7 +72,7 @@
func (t placeholderMessage) Enums() pref.EnumDescriptors { return &emptyEnums }
func (t placeholderMessage) Messages() pref.MessageDescriptors { return &emptyMessages }
func (t placeholderMessage) Extensions() pref.ExtensionDescriptors { return &emptyExtensions }
-func (t placeholderMessage) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t placeholderMessage) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t placeholderMessage) ProtoType(pref.MessageDescriptor) {}
type placeholderEnum struct {
@@ -83,5 +83,5 @@
func (t placeholderEnum) Values() pref.EnumValueDescriptors { return &emptyEnumValues }
func (t placeholderEnum) ReservedNames() pref.Names { return &emptyNames }
func (t placeholderEnum) ReservedRanges() pref.EnumRanges { return &emptyEnumRanges }
-func (t placeholderEnum) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t placeholderEnum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t placeholderEnum) ProtoType(pref.EnumDescriptor) {}
diff --git a/internal/prototype/protofile_list.go b/internal/prototype/protofile_list.go
index ad37f68..41bcdcc 100644
--- a/internal/prototype/protofile_list.go
+++ b/internal/prototype/protofile_list.go
@@ -8,9 +8,9 @@
"fmt"
"sync"
- pragma "google.golang.org/protobuf/internal/pragma"
- pset "google.golang.org/protobuf/internal/set"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/pragma"
+ "google.golang.org/protobuf/internal/set"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -26,7 +26,7 @@
}
return false
}
-func (p *names) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *names) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *names) ProtoInternal(pragma.DoNotImplement) {}
// Names returns a Names list from a slice of names.
@@ -35,7 +35,7 @@
type numbersMeta struct {
once sync.Once
ns []pref.FieldNumber
- nss pset.Ints
+ nss set.Ints
}
type numbers numbersMeta
@@ -53,7 +53,7 @@
func (p *numbers) Len() int { return len(p.ns) }
func (p *numbers) Get(i int) pref.FieldNumber { return p.ns[i] }
func (p *numbers) Has(n pref.FieldNumber) bool { return p.nss.Has(uint64(n)) }
-func (p *numbers) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *numbers) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *numbers) ProtoInternal(pragma.DoNotImplement) {}
type fieldRanges [][2]pref.FieldNumber
@@ -68,7 +68,7 @@
}
return false
}
-func (p *fieldRanges) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *fieldRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fieldRanges) ProtoInternal(pragma.DoNotImplement) {}
// FieldRanges returns a FieldRanges list from a slice of ranges.
@@ -86,7 +86,7 @@
}
return false
}
-func (p *enumRanges) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *enumRanges) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *enumRanges) ProtoInternal(pragma.DoNotImplement) {}
// EnumRanges returns an EnumRanges list from a slice of ranges.
@@ -96,7 +96,7 @@
func (p *fileImports) Len() int { return len(*p) }
func (p *fileImports) Get(i int) pref.FileImport { return (*p)[i] }
-func (p *fileImports) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *fileImports) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fileImports) ProtoInternal(pragma.DoNotImplement) {}
type oneofFieldsMeta struct {
@@ -136,5 +136,5 @@
func (p *oneofFields) ByName(s pref.Name) pref.FieldDescriptor { return p.byName[s] }
func (p *oneofFields) ByJSONName(s string) pref.FieldDescriptor { return p.byJSON[s] }
func (p *oneofFields) ByNumber(n pref.FieldNumber) pref.FieldDescriptor { return p.byNum[n] }
-func (p *oneofFields) Format(s fmt.State, r rune) { pfmt.FormatList(s, r, p) }
+func (p *oneofFields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *oneofFields) ProtoInternal(pragma.DoNotImplement) {}
diff --git a/internal/prototype/protofile_list_gen.go b/internal/prototype/protofile_list_gen.go
index 6001603..695b66e 100644
--- a/internal/prototype/protofile_list_gen.go
+++ b/internal/prototype/protofile_list_gen.go
@@ -10,8 +10,8 @@
"fmt"
"sync"
+ "google.golang.org/protobuf/internal/descfmt"
"google.golang.org/protobuf/internal/pragma"
- "google.golang.org/protobuf/internal/typefmt"
"google.golang.org/protobuf/reflect/protoreflect"
)
@@ -58,7 +58,7 @@
}
return messageDesc{t}
}
-func (p *messages) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *messages) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *messages) ProtoInternal(pragma.DoNotImplement) {}
type fieldsMeta struct {
@@ -145,7 +145,7 @@
}
return fieldDesc{t}
}
-func (p *fields) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *fields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *fields) ProtoInternal(pragma.DoNotImplement) {}
type oneofsMeta struct {
@@ -191,7 +191,7 @@
}
return oneofDesc{t}
}
-func (p *oneofs) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *oneofs) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *oneofs) ProtoInternal(pragma.DoNotImplement) {}
type extensionsMeta struct {
@@ -237,7 +237,7 @@
}
return extensionDesc{t}
}
-func (p *extensions) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *extensions) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *extensions) ProtoInternal(pragma.DoNotImplement) {}
type enumsMeta struct {
@@ -283,7 +283,7 @@
}
return enumDesc{t}
}
-func (p *enums) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *enums) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *enums) ProtoInternal(pragma.DoNotImplement) {}
type enumValuesMeta struct {
@@ -349,7 +349,7 @@
}
return enumValueDesc{t}
}
-func (p *enumValues) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *enumValues) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *enumValues) ProtoInternal(pragma.DoNotImplement) {}
type servicesMeta struct {
@@ -395,7 +395,7 @@
}
return serviceDesc{t}
}
-func (p *services) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *services) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *services) ProtoInternal(pragma.DoNotImplement) {}
type methodsMeta struct {
@@ -441,5 +441,5 @@
}
return methodDesc{t}
}
-func (p *methods) Format(s fmt.State, r rune) { typefmt.FormatList(s, r, p) }
+func (p *methods) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
func (p *methods) ProtoInternal(pragma.DoNotImplement) {}
diff --git a/internal/prototype/protofile_type.go b/internal/prototype/protofile_type.go
index 99b0a53..a560b73 100644
--- a/internal/prototype/protofile_type.go
+++ b/internal/prototype/protofile_type.go
@@ -10,9 +10,9 @@
"strings"
"sync"
- descopts "google.golang.org/protobuf/internal/descopts"
- pragma "google.golang.org/protobuf/internal/pragma"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/descopts"
+ "google.golang.org/protobuf/internal/pragma"
"google.golang.org/protobuf/reflect/protoreflect"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -78,7 +78,7 @@
func (t fileDesc) Messages() pref.MessageDescriptors { return t.f.ms.lazyInit(t, t.f.Messages) }
func (t fileDesc) Extensions() pref.ExtensionDescriptors { return t.f.xs.lazyInit(t, t.f.Extensions) }
func (t fileDesc) Services() pref.ServiceDescriptors { return t.f.ss.lazyInit(t, t.f.Services) }
-func (t fileDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t fileDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t fileDesc) ProtoType(pref.FileDescriptor) {}
func (t fileDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -126,7 +126,7 @@
func (t messageDesc) Enums() pref.EnumDescriptors { return t.m.es.lazyInit(t, t.m.Enums) }
func (t messageDesc) Messages() pref.MessageDescriptors { return t.m.ms.lazyInit(t, t.m.Messages) }
func (t messageDesc) Extensions() pref.ExtensionDescriptors { return t.m.xs.lazyInit(t, t.m.Extensions) }
-func (t messageDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t messageDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t messageDesc) ProtoType(pref.MessageDescriptor) {}
func (t messageDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -201,7 +201,7 @@
}
func (t fieldDesc) Enum() pref.EnumDescriptor { return t.f.et.lazyInit(t, &t.f.EnumType) }
func (t fieldDesc) Message() pref.MessageDescriptor { return t.f.mt.lazyInit(t, &t.f.MessageType) }
-func (t fieldDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t fieldDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t fieldDesc) ProtoType(pref.FieldDescriptor) {}
func (t fieldDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -288,7 +288,7 @@
func (t oneofDesc) IsPlaceholder() bool { return false }
func (t oneofDesc) Options() pref.ProtoMessage { return altOptions(t.o.Options, descopts.Oneof) }
func (t oneofDesc) Fields() pref.FieldDescriptors { return t.o.fs.lazyInit(t) }
-func (t oneofDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t oneofDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t oneofDesc) ProtoType(pref.OneofDescriptor) {}
func (t oneofDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -336,7 +336,7 @@
}
func (t extensionDesc) Enum() pref.EnumDescriptor { return t.x.et.lazyInit(t, &t.x.EnumType) }
func (t extensionDesc) Message() pref.MessageDescriptor { return t.x.mt.lazyInit(t, &t.x.MessageType) }
-func (t extensionDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t extensionDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t extensionDesc) ProtoType(pref.FieldDescriptor) {}
func (t extensionDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -362,7 +362,7 @@
func (t enumDesc) Values() pref.EnumValueDescriptors { return t.e.vs.lazyInit(t, t.e.Values) }
func (t enumDesc) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
func (t enumDesc) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
-func (t enumDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t enumDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t enumDesc) ProtoType(pref.EnumDescriptor) {}
func (t enumDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -382,7 +382,7 @@
return altOptions(t.v.Options, descopts.EnumValue)
}
func (t enumValueDesc) Number() pref.EnumNumber { return t.v.Number }
-func (t enumValueDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t enumValueDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t enumValueDesc) ProtoType(pref.EnumValueDescriptor) {}
func (t enumValueDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -404,7 +404,7 @@
return altOptions(t.s.Options, descopts.Service)
}
func (t serviceDesc) Methods() pref.MethodDescriptors { return t.s.ms.lazyInit(t, t.s.Methods) }
-func (t serviceDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t serviceDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t serviceDesc) ProtoType(pref.ServiceDescriptor) {}
func (t serviceDesc) ProtoInternal(pragma.DoNotImplement) {}
@@ -428,7 +428,7 @@
func (t methodDesc) Output() pref.MessageDescriptor { return t.m.mot.lazyInit(t, &t.m.OutputType) }
func (t methodDesc) IsStreamingClient() bool { return t.m.IsStreamingClient }
func (t methodDesc) IsStreamingServer() bool { return t.m.IsStreamingServer }
-func (t methodDesc) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t methodDesc) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t methodDesc) ProtoType(pref.MethodDescriptor) {}
func (t methodDesc) ProtoInternal(pragma.DoNotImplement) {}
diff --git a/internal/prototype/standalone_type.go b/internal/prototype/standalone_type.go
index 54a6ef5..f2960a5 100644
--- a/internal/prototype/standalone_type.go
+++ b/internal/prototype/standalone_type.go
@@ -7,9 +7,9 @@
import (
"fmt"
- descopts "google.golang.org/protobuf/internal/descopts"
- pragma "google.golang.org/protobuf/internal/pragma"
- pfmt "google.golang.org/protobuf/internal/typefmt"
+ "google.golang.org/protobuf/internal/descfmt"
+ "google.golang.org/protobuf/internal/descopts"
+ "google.golang.org/protobuf/internal/pragma"
pref "google.golang.org/protobuf/reflect/protoreflect"
)
@@ -42,7 +42,7 @@
func (t standaloneMessage) Enums() pref.EnumDescriptors { return &emptyEnums }
func (t standaloneMessage) Messages() pref.MessageDescriptors { return &emptyMessages }
func (t standaloneMessage) Extensions() pref.ExtensionDescriptors { return &emptyExtensions }
-func (t standaloneMessage) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t standaloneMessage) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t standaloneMessage) ProtoType(pref.MessageDescriptor) {}
func (t standaloneMessage) ProtoInternal(pragma.DoNotImplement) {}
@@ -61,7 +61,7 @@
func (t standaloneEnum) Values() pref.EnumValueDescriptors { return t.e.vals.lazyInit(t, t.e.Values) }
func (t standaloneEnum) ReservedNames() pref.Names { return (*names)(&t.e.ReservedNames) }
func (t standaloneEnum) ReservedRanges() pref.EnumRanges { return (*enumRanges)(&t.e.ReservedRanges) }
-func (t standaloneEnum) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t standaloneEnum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t standaloneEnum) ProtoType(pref.EnumDescriptor) {}
func (t standaloneEnum) ProtoInternal(pragma.DoNotImplement) {}
@@ -100,7 +100,7 @@
func (t standaloneExtension) ContainingMessage() pref.MessageDescriptor { return t.x.ExtendedType }
func (t standaloneExtension) Enum() pref.EnumDescriptor { return t.x.EnumType }
func (t standaloneExtension) Message() pref.MessageDescriptor { return t.x.MessageType }
-func (t standaloneExtension) Format(s fmt.State, r rune) { pfmt.FormatDesc(s, r, t) }
+func (t standaloneExtension) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, t) }
func (t standaloneExtension) ProtoType(pref.FieldDescriptor) {}
func (t standaloneExtension) ProtoInternal(pragma.DoNotImplement) {}