소스 검색

proto: deprecate ErrInternalBadWireType

Nothing uses this error.

Change-Id: I30e94c2b6f3c7865c40d8536d371c7e04b5af908
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167040
Reviewed-by: Herbie Ong <herbie@google.com>
Joe Tsai 6 년 전
부모
커밋
e581f92ac6
2개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 0 4
      proto/decode.go
  2. 3 0
      proto/deprecated.go

+ 0 - 4
proto/decode.go

@@ -17,10 +17,6 @@ import (
 // errOverflow is returned when an integer is too large to be represented.
 var errOverflow = errors.New("proto: integer overflow")
 
-// ErrInternalBadWireType is returned by generated code when an incorrect
-// wire type is encountered. It does not get returned to user code.
-var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
-
 // DecodeVarint reads a varint-encoded integer from the slice.
 // It returns the integer and the number of bytes consumed, or
 // zero if there is not enough.

+ 3 - 0
proto/deprecated.go

@@ -10,6 +10,9 @@ import (
 	"github.com/golang/protobuf/protoapi"
 )
 
+// Deprecated: do not use.
+var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
+
 // Deprecated: do not use.
 type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }