Skip to content

Commit

Permalink
internal/errors: delete compatibility code for Go before 1.13
Browse files Browse the repository at this point in the history
Currently, Go Protobuf requires Go 1.21.

Change-Id: I0b923f4f7732d54628f84e93adccc12f74f14e8e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/637475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chressie Himpel <chressie@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
  • Loading branch information
stapelberg authored and gopherbot committed Dec 18, 2024
1 parent 607da3e commit ce4fa19
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 58 deletions.
6 changes: 3 additions & 3 deletions internal/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ func TestErrors(t *testing.T) {
if got, want := test.err.Error(), prefix+test.wantText; got != want {
t.Errorf("%v.Error() = %q, want %q", test.what, got, want)
}
if got, want := Is(test.err, Error), true; got != want {
if got, want := errors.Is(test.err, Error), true; got != want {
t.Errorf("errors.Is(%v, errors.Error) = %v, want %v", test.what, got, want)
}
for _, err := range test.is {
if got, want := Is(test.err, err), true; got != want {
if got, want := errors.Is(test.err, err), true; got != want {
t.Errorf("errors.Is(%v, %v) = %v, want %v", test.what, err, got, want)
}
}
for _, err := range test.isNot {
if got, want := Is(test.err, err), false; got != want {
if got, want := errors.Is(test.err, err), false; got != want {
t.Errorf("errors.Is(%v, %v) = %v, want %v", test.what, err, got, want)
}
}
Expand Down
40 changes: 0 additions & 40 deletions internal/errors/is_go112.go

This file was deleted.

13 changes: 0 additions & 13 deletions internal/errors/is_go113.go

This file was deleted.

2 changes: 1 addition & 1 deletion proto/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package proto_test

import (
"bytes"
"errors"
"fmt"
"reflect"
"testing"
Expand All @@ -16,7 +17,6 @@ import (
"google.golang.org/protobuf/testing/protopack"
"google.golang.org/protobuf/types/known/durationpb"

"google.golang.org/protobuf/internal/errors"
testpb "google.golang.org/protobuf/internal/testprotos/test"
test3pb "google.golang.org/protobuf/internal/testprotos/test3"
)
Expand Down
2 changes: 1 addition & 1 deletion proto/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package proto_test

import (
"bytes"
"errors"
"fmt"
"math"
"reflect"
Expand All @@ -19,7 +20,6 @@ import (
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/known/durationpb"

"google.golang.org/protobuf/internal/errors"
orderpb "google.golang.org/protobuf/internal/testprotos/order"
testpb "google.golang.org/protobuf/internal/testprotos/test"
test3pb "google.golang.org/protobuf/internal/testprotos/test3"
Expand Down

0 comments on commit ce4fa19

Please sign in to comment.