all: rename ExtensionType Descriptor method to TypeDescriptor (2/2)

Remove the ExtensionType Descriptor method.

Change-Id: I89c985c45f2a5abc4e4e3770f9652bc2a444251e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/192141
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
Damien Neil 2019-08-28 11:42:46 -07:00
parent 79bfdbe45b
commit 3cda377ed2
7 changed files with 10 additions and 16 deletions

View File

@ -3,7 +3,7 @@ module google.golang.org/protobuf/cmd/protoc-gen-go-grpc/testdata
go 1.9
require (
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
github.com/golang/protobuf v1.2.1-0.20190828184314-28cdcb54310f
google.golang.org/grpc v1.19.0
google.golang.org/protobuf v1.0.0
)

View File

@ -3,7 +3,7 @@ module google.golang.org/protobuf/cmd/protoc-gen-go/testdata
go 1.9
require (
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
github.com/golang/protobuf v1.2.1-0.20190828184314-28cdcb54310f
google.golang.org/protobuf v1.0.0
)

2
go.mod
View File

@ -3,6 +3,6 @@ module google.golang.org/protobuf
go 1.9
require (
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
github.com/golang/protobuf v1.2.1-0.20190828184314-28cdcb54310f
github.com/google/go-cmp v0.3.0
)

3
go.sum
View File

@ -12,6 +12,8 @@ github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd h1:KtPU12Q37ryZW
github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd/go.mod h1:x87I3ou7ehf/yR6iQ88MkyDogdxXN04TELJ7HVy7V7I=
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435 h1:mh1ym3CXIEzWTZlfDucUHHIbroKZ8ri4E3dbxu80las=
github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435/go.mod h1:k7dGkiTZ3rjVDhKSpGt+x1zDzAePJk4jdhoBwIkQgBo=
github.com/golang/protobuf v1.2.1-0.20190828184314-28cdcb54310f h1:S72Y7P/ygIGdj6ZTtWtBDYKMEHudzFg0KqWXGgQ/U4I=
github.com/golang/protobuf v1.2.1-0.20190828184314-28cdcb54310f/go.mod h1:o4el5ABfDjqFlwwvAq2OIgAPeNXQYUkhtrjNPXy6T6I=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
google.golang.org/protobuf v0.0.0-20190514172829-e89e6244e0e8/go.mod h1:791zQGC15vDqjpmPRn1uGPu5oHy/Jzw/Q1n5JsgIIcY=
@ -25,3 +27,4 @@ google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59/go.mod h1:of3pt14Y
google.golang.org/protobuf v0.0.0-20190717230113-f647c82cc3c7/go.mod h1:yGm7aNHn9Bp1NIvj6+CVUkcJshu+Usshfd3A+YxEuI8=
google.golang.org/protobuf v0.0.0-20190820203659-c0f8c0a24ece/go.mod h1:tRqhEyKwbKqwt5CQZAuOtj09RfhLNklDOhndhYA9blU=
google.golang.org/protobuf v0.0.0-20190820213257-f1e905b04207/go.mod h1:UJqt2ZERO8/qk5A9t8Ujq6OJ+MNvOQpg9X4RKyYz9Ho=
google.golang.org/protobuf v0.0.0-20190828183429-79bfdbe45be2/go.mod h1:fYMzYhnMXLj/kGDPzNOptS3IFFlQjWTlu2j3ZPET2lw=

View File

@ -118,10 +118,6 @@ func (xi *ExtensionInfo) GoType() reflect.Type {
xi.lazyInit()
return xi.goType
}
func (xi *ExtensionInfo) Descriptor() pref.ExtensionTypeDescriptor {
// TODO: Remove.
return xi.TypeDescriptor()
}
func (xi *ExtensionInfo) TypeDescriptor() pref.ExtensionTypeDescriptor {
if atomic.LoadUint32(&xi.init) == extensionInfoUninitialized {
xi.lazyInitSlow()

View File

@ -73,13 +73,13 @@
// ProtoMessage, which can convert to/from a Message.
//
//
// ┌── Descriptor() ──┐ ┌──── Descriptor() ────┐
// V │ V
// ┌── TypeDescriptor() ──┐ ┌──── Descriptor() ────┐
// V │ V
// ╔═══════════════╗ ╔═════════════════════════╗ ╔═════════════════════╗
// ║ ExtensionType ║ ║ ExtensionTypeDescriptor ║ ║ ExtensionDescriptor ║
// ╚═══════════════╝ ╚═════════════════════════╝ ╚═════════════════════╝
// Λ │ │ Λ │ Λ
// └───── Type() ─────┘ │ └─── may implement ────┘ │
// Λ │ │ Λ │ Λ
// ─────── Type() ───────┘ │ └─── may implement ────┘ │
// │ │
// └────── implements ────────┘
//

View File

@ -464,11 +464,6 @@ type ExtensionType interface {
// TypeDescriptor returns the extension type descriptor.
TypeDescriptor() ExtensionTypeDescriptor
// Descriptor is deprecated.
//
// TODO: remove.
Descriptor() ExtensionTypeDescriptor
// TODO: What to do with nil?
// Should ValueOf(nil) return Value{}?
// Should InterfaceOf(Value{}) return nil?