internal/impl: clean up obsolete ExtensionInfo fields/funcs
This is change 5/5 in a series of commits changing protoV1.ExtensionDesc
to directly implement protoreflect.ExtensionType.
1. [v2] Add protoimpl.ExtensionInfo as an alias for
protoiface.ExtensionDescV1.
2. [v1] Update references to protoimpl.ExtensionInfo to use
protoiface.ExtensionInfo.
3. [v2] Create protoimpl.ExtensionInfo (an alias to a new type in
the impl package) and remove protoiface.ExtensionDescV1.
4. [v1] Remove unneeded explicit conversions between ExtensionDesc and
ExtensionType (since the former now directly implements the latter).
5. [v2] Remove stub conversion functions.
Change-Id: I1fdfb18c481e72a362a6f9ee0e440f8f909790ca
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/189564
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/cmd/protoc-gen-go-grpc/testdata/go.mod b/cmd/protoc-gen-go-grpc/testdata/go.mod
index 0879f28..acca211 100644
--- a/cmd/protoc-gen-go-grpc/testdata/go.mod
+++ b/cmd/protoc-gen-go-grpc/testdata/go.mod
@@ -1,7 +1,7 @@
module google.golang.org/protobuf/cmd/protoc-gen-go-grpc/testdata
require (
- github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd
+ github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
google.golang.org/grpc v1.19.0
google.golang.org/protobuf v1.0.0
)
diff --git a/cmd/protoc-gen-go/testdata/go.mod b/cmd/protoc-gen-go/testdata/go.mod
index 94d6dd1..0eb1883 100644
--- a/cmd/protoc-gen-go/testdata/go.mod
+++ b/cmd/protoc-gen-go/testdata/go.mod
@@ -1,7 +1,7 @@
module google.golang.org/protobuf/cmd/protoc-gen-go/testdata
require (
- github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd
+ github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
google.golang.org/protobuf v1.0.0
)
diff --git a/go.mod b/go.mod
index 9c4be5c..4bf4997 100644
--- a/go.mod
+++ b/go.mod
@@ -3,6 +3,6 @@
go 1.9
require (
- github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd
+ github.com/golang/protobuf v1.2.1-0.20190820213554-ae1d65bc5435
github.com/google/go-cmp v0.3.0
)
diff --git a/go.sum b/go.sum
index aa8565c..7b43351 100644
--- a/go.sum
+++ b/go.sum
@@ -10,6 +10,8 @@
github.com/golang/protobuf v1.2.1-0.20190806214225-7037721e6de0/go.mod h1:tDQPRlaHYu9yt1wPgdx85inRiLvUCuJZXsYjC0mwc1c=
github.com/golang/protobuf v1.2.1-0.20190820204156-2da1b93405dd h1:KtPU12Q37ryZW+7L97q/3GAhHtFXRjEkulcRj4dnSvA=
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/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=
@@ -22,3 +24,4 @@
google.golang.org/protobuf v0.0.0-20190620020611-d888139e7b59/go.mod h1:of3pt14Y+dOxz2tBOHXEoapPpKFC15/0zWhPAddkfsU=
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=
diff --git a/internal/impl/api_export.go b/internal/impl/api_export.go
index 41f7b7e..8c35f8f 100644
--- a/internal/impl/api_export.go
+++ b/internal/impl/api_export.go
@@ -93,10 +93,3 @@
func (Export) ExtensionDescFromType(t pref.ExtensionType) *ExtensionInfo {
return legacyExtensionDescFromType(t)
}
-
-// ExtensionTypeFromDesc returns the v2 protoreflect.ExtensionType for d.
-//
-// TODO: Remove after updating v1 to no longer call this.
-func (Export) ExtensionTypeFromDesc(d *ExtensionInfo) pref.ExtensionType {
- return d
-}
diff --git a/internal/impl/extension.go b/internal/impl/extension.go
index e7083e5..1ba473d 100644
--- a/internal/impl/extension.go
+++ b/internal/impl/extension.go
@@ -43,9 +43,6 @@
goType reflect.Type
conv Converter
- // TODO: Remove after updating v2 to not set this.
- Type interface{}
-
// ExtendedType is a typed nil-pointer to the parent message type that
// is being extended. It is possible for this to be unpopulated in v2
// since the message may no longer implement the MessageV1 interface.