Selaa lähdekoodia

proto: rename protoiface.ExtensionDescV1 to protoimpl.ExtensionInfo

This is change 2/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: Icf5f789bac950bda14e84b8f6250e0399cb0efdf
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/189677
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Damien Neil 6 vuotta sitten
vanhempi
commit
2da1b93405
4 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 1 1
      go.mod
  2. 2 0
      go.sum
  3. 2 1
      internal/proto/common.go
  4. 1 1
      proto/extensions.go

+ 1 - 1
go.mod

@@ -2,4 +2,4 @@ module github.com/golang/protobuf
 
 go 1.9
 
-require google.golang.org/protobuf v0.0.0-20190808204900-1799d1111a45
+require google.golang.org/protobuf v0.0.0-20190820203659-c0f8c0a24ece

+ 2 - 0
go.sum

@@ -21,3 +21,5 @@ google.golang.org/protobuf v0.0.0-20190717230113-f647c82cc3c7 h1:U6U+Hb+UKNGJB0e
 google.golang.org/protobuf v0.0.0-20190717230113-f647c82cc3c7/go.mod h1:yGm7aNHn9Bp1NIvj6+CVUkcJshu+Usshfd3A+YxEuI8=
 google.golang.org/protobuf v0.0.0-20190808204900-1799d1111a45 h1:SZXAIsI6RiG0T8bAF4dqHDHgdqJtOa6tkofjswKtU20=
 google.golang.org/protobuf v0.0.0-20190808204900-1799d1111a45/go.mod h1:tRqhEyKwbKqwt5CQZAuOtj09RfhLNklDOhndhYA9blU=
+google.golang.org/protobuf v0.0.0-20190820203659-c0f8c0a24ece h1:AFYGmds8FWBGNw0zddlFiGtDvkVFSnQ7J2bAdH4X9Xk=
+google.golang.org/protobuf v0.0.0-20190820203659-c0f8c0a24ece/go.mod h1:tRqhEyKwbKqwt5CQZAuOtj09RfhLNklDOhndhYA9blU=

+ 2 - 1
internal/proto/common.go

@@ -13,11 +13,12 @@ import (
 	"reflect"
 
 	"google.golang.org/protobuf/runtime/protoiface"
+	"google.golang.org/protobuf/runtime/protoimpl"
 )
 
 type (
 	Message       = protoiface.MessageV1
-	ExtensionDesc = protoiface.ExtensionDescV1
+	ExtensionDesc = protoimpl.ExtensionInfo
 )
 
 // RequiredNotSetError is an error type returned by either Marshal or Unmarshal.

+ 1 - 1
proto/extensions.go

@@ -83,7 +83,7 @@ var errNotExtendable = errors.New("proto: not an extendable proto.Message")
 
 type (
 	ExtensionRange         = protoiface.ExtensionRangeV1
-	ExtensionDesc          = protoiface.ExtensionDescV1
+	ExtensionDesc          = protoimpl.ExtensionInfo
 	Extension              = protoimpl.ExtensionFieldV1
 	XXX_InternalExtensions = protoimpl.ExtensionFields
 )