mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
replace deprecated method after transitive dependency update
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
12c2b470bc
commit
c3f990f0a2
@ -17,7 +17,8 @@
|
|||||||
package streams
|
package streams
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/protobuf/ptypes"
|
"google.golang.org/protobuf/proto"
|
||||||
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
|
|
||||||
streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1"
|
streamsv1 "github.com/docker/compose-cli/cli/server/protos/streams/v1"
|
||||||
)
|
)
|
||||||
@ -34,7 +35,7 @@ func (io *IO) Read(p []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var m streamsv1.BytesMessage
|
var m streamsv1.BytesMessage
|
||||||
err = ptypes.UnmarshalAny(a, &m)
|
err = anypb.UnmarshalTo(a, &m, proto.UnmarshalOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -52,7 +53,7 @@ func (io *IO) Write(p []byte) (n int, err error) {
|
|||||||
Value: p,
|
Value: p,
|
||||||
}
|
}
|
||||||
|
|
||||||
m, err := ptypes.MarshalAny(&message)
|
m, err := anypb.New(&message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ import (
|
|||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/protobuf/types/known/anypb"
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
|
|
||||||
"github.com/golang/protobuf/ptypes"
|
|
||||||
"github.com/golang/protobuf/ptypes/any"
|
"github.com/golang/protobuf/ptypes/any"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
"gotest.tools/v3/assert/cmp"
|
"gotest.tools/v3/assert/cmp"
|
||||||
@ -76,7 +75,7 @@ func getReader(t *testing.T, in []byte, errResult error) IO {
|
|||||||
Type: streamsv1.IOStream_STDOUT,
|
Type: streamsv1.IOStream_STDOUT,
|
||||||
Value: in,
|
Value: in,
|
||||||
}
|
}
|
||||||
m, err := ptypes.MarshalAny(&message)
|
m, err := anypb.New(&message)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
return IO{
|
return IO{
|
||||||
@ -90,7 +89,7 @@ func getReader(t *testing.T, in []byte, errResult error) IO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getAny(t *testing.T, in []byte) *any.Any {
|
func getAny(t *testing.T, in []byte) *any.Any {
|
||||||
value, err := ptypes.MarshalAny(&streamsv1.BytesMessage{
|
value, err := anypb.New(&streamsv1.BytesMessage{
|
||||||
Type: streamsv1.IOStream_STDOUT,
|
Type: streamsv1.IOStream_STDOUT,
|
||||||
Value: in,
|
Value: in,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user