Skip to content

Commit bfcda1e

Browse files
committed
chore: vet + remove invalid make targets
Signed-off-by: Zachary Spar <zachspar@gmail.com>
1 parent eb4ed94 commit bfcda1e

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
117117
clean:

pkg/fssync/diffcopy_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"testing"
2525

2626
"github.com/tonistiigi/fsutil/types"
27+
"google.golang.org/protobuf/proto"
2728
)
2829

2930
type 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

0 commit comments

Comments
 (0)