all: remove dependency on proto v1
This does not remove all dependencies,
but all of the cases where it can now be implemented in terms of v2.
Change-Id: Idc5b0273f0d35c284bf2141eb9cce998692ceb15
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/184878
Reviewed-by: Herbie Ong <herbie@google.com>
diff --git a/encoding/protojson/decode_test.go b/encoding/protojson/decode_test.go
index 0de7d7f..5797a8b 100644
--- a/encoding/protojson/decode_test.go
+++ b/encoding/protojson/decode_test.go
@@ -8,7 +8,6 @@
"math"
"testing"
- protoV1 "github.com/golang/protobuf/proto"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/encoding/testprotos/pb2"
"google.golang.org/protobuf/encoding/testprotos/pb3"
@@ -2483,7 +2482,7 @@
if err == nil && tt.wantErr {
t.Error("Unmarshal() got nil error, want error\n\n")
}
- if tt.wantMessage != nil && !protoV1.Equal(tt.inputMessage.(protoV1.Message), tt.wantMessage.(protoV1.Message)) {
+ if tt.wantMessage != nil && !proto.Equal(tt.inputMessage, tt.wantMessage) {
t.Errorf("Unmarshal()\n<got>\n%v\n<want>\n%v\n", tt.inputMessage, tt.wantMessage)
}
})
diff --git a/encoding/prototext/decode_test.go b/encoding/prototext/decode_test.go
index 7f0a4e8..799de2e 100644
--- a/encoding/prototext/decode_test.go
+++ b/encoding/prototext/decode_test.go
@@ -8,7 +8,6 @@
"math"
"testing"
- protoV1 "github.com/golang/protobuf/proto"
"google.golang.org/protobuf/encoding/prototext"
pimpl "google.golang.org/protobuf/internal/impl"
"google.golang.org/protobuf/internal/scalar"
@@ -1498,7 +1497,7 @@
if err == nil && tt.wantErr {
t.Error("Unmarshal() got nil error, want error\n\n")
}
- if tt.wantMessage != nil && !protoV1.Equal(tt.inputMessage.(protoV1.Message), tt.wantMessage.(protoV1.Message)) {
+ if tt.wantMessage != nil && !proto.Equal(tt.inputMessage, tt.wantMessage) {
t.Errorf("Unmarshal()\n<got>\n%v\n<want>\n%v\n", tt.inputMessage, tt.wantMessage)
}
})
diff --git a/encoding/prototext/other_test.go b/encoding/prototext/other_test.go
index ec1842f..5b3376b 100644
--- a/encoding/prototext/other_test.go
+++ b/encoding/prototext/other_test.go
@@ -7,7 +7,6 @@
import (
"testing"
- protoV1 "github.com/golang/protobuf/proto"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/internal/impl"
pimpl "google.golang.org/protobuf/internal/impl"
@@ -240,7 +239,7 @@
t.Errorf("Unmarshal() returned error: %v\n\n", err)
}
- if !protoV1.Equal(gotMessage, tt.message.(protoV1.Message)) {
+ if !proto.Equal(gotMessage, tt.message) {
t.Errorf("Unmarshal()\n<got>\n%v\n<want>\n%v\n", gotMessage, tt.message)
}
})