File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ image: build-linux
111111 container build -t $(BINARY_NAME ) :$(GIT_TAG ) .
112112
113113.PHONY : release
114- release : fmt vet lint test build-linux docker- image
114+ release : fmt vet lint test image
115115
116116.PHONY : clean
117117clean :
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
2424 "testing"
2525
2626 "github.com/tonistiigi/fsutil/types"
27+ "google.golang.org/protobuf/proto"
2728)
2829
2930type mockConn struct {
@@ -46,7 +47,8 @@ func (m *mockConn) RecvMsg(msg any) error {
4647 }
4748 switch t := msg .(type ) {
4849 case * types.Packet :
49- * t = * p
50+ t .Reset ()
51+ proto .Merge (t , p )
5052 default :
5153 return errors .New ("unexpected type to RecvMsg" )
5254 }
@@ -61,8 +63,11 @@ func (m *mockConn) SendMsg(msg any) error {
6163 if ! ok {
6264 return errors .New ("SendMsg expects *types.Packet" )
6365 }
64- cp := * p
65- m .sent = append (m .sent , & cp )
66+ cloned , ok := proto .Clone (p ).(* types.Packet )
67+ if ! ok {
68+ return errors .New ("SendMsg failed to clone *types.Packet" )
69+ }
70+ m .sent = append (m .sent , cloned )
6671 return nil
6772}
6873
You can’t perform that action at this time.
0 commit comments