aboutsummaryrefslogtreecommitdiff
path: root/weed/pb
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-18 00:15:46 -0700
committerchrislu <chris.lu@gmail.com>2022-08-18 00:15:46 -0700
commit4573c99ae34530e562dc7ffcc261bd27224a71e7 (patch)
tree3df84c1d13610ef0c8075dbbeb22d0c0594112d6 /weed/pb
parent4ffbda1c4323fc2b4cba04c7caf736c5374b7cdf (diff)
downloadseaweedfs-4573c99ae34530e562dc7ffcc261bd27224a71e7.tar.xz
seaweedfs-4573c99ae34530e562dc7ffcc261bd27224a71e7.zip
fix tests
Diffstat (limited to 'weed/pb')
-rw-r--r--weed/pb/proto_read_write_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/pb/proto_read_write_test.go b/weed/pb/proto_read_write_test.go
index ac3b960ee..06dc136b0 100644
--- a/weed/pb/proto_read_write_test.go
+++ b/weed/pb/proto_read_write_test.go
@@ -16,15 +16,15 @@ func TestJsonpMarshalUnmarshal(t *testing.T) {
FileSize: 12,
}
- m := jsonpb.Marshaler{
- EmitDefaults: true,
- Indent: " ",
+ m := jsonpb.MarshalOptions{
+ EmitUnpopulated: true,
+ Indent: " ",
}
- if text, err := m.MarshalToString(tv); err != nil {
+ if text, err := m.Marshal(tv); err != nil {
fmt.Printf("marshal eror: %v\n", err)
} else {
- fmt.Printf("marshalled: %s\n", text)
+ fmt.Printf("marshalled: %s\n", string(text))
}
rawJson := `{
@@ -34,7 +34,7 @@ func TestJsonpMarshalUnmarshal(t *testing.T) {
}`
tv1 := &volume_server_pb.RemoteFile{}
- if err := jsonpb.UnmarshalString(rawJson, tv1); err != nil {
+ if err := jsonpb.Unmarshal([]byte(rawJson), tv1); err != nil {
fmt.Printf("unmarshal error: %v\n", err)
}