Skip to content

Commit 3d98454

Browse files
feat: migrate from golang gomock to uber gomock (runfinch#1431)
Signed-off-by: shubhranshu153 <[email protected]>
1 parent 0ceab64 commit 3d98454

File tree

64 files changed

+315
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+315
-207
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ download-licenses:
199199

200200
### dependencies in tools.go - start ###
201201

202-
# for github.com/golang/mock/mockgen
203-
mkdir -p "$(LICENSEDIR)/github.com/golang/mock"
204-
curl https://raw.githubusercontent.com/golang/mock/main/LICENSE --output "$(LICENSEDIR)/github.com/golang/mock/LICENSE"
202+
# for go.uber.org/mock/mockgen
203+
mkdir -p "$(LICENSEDIR)/go.uber.org/mock"
204+
curl https://raw.githubusercontent.com/golang/mock/main/LICENSE --output "$(LICENSEDIR)/go.uber.org/mock/LICENSE"
205205
# for github.com/google/go-licenses
206206
mkdir -p "$(LICENSEDIR)/github.com/google/go-licenses"
207207
curl https://raw.githubusercontent.com/google/go-licenses/master/LICENSE --output "$(LICENSEDIR)/github.com/google/go-licenses/LICENSE"
@@ -354,7 +354,7 @@ test-benchmark-container:
354354
# To add a new tool binary to the recipe below, please also checkout out `pkg/tools.go`.
355355
gen-code: GOBIN = $(CURDIR)/tools_bin
356356
gen-code:
357-
GOBIN=$(GOBIN) go install github.com/golang/mock/mockgen
357+
GOBIN=$(GOBIN) go install go.uber.org/mock/mockgen
358358
GOBIN=$(GOBIN) go install golang.org/x/tools/cmd/stringer
359359
# Make sure that we are using the tool binaries which are just built to generate code.
360360
ifeq ($(GOOS),windows)

cmd/finch/gen_docs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313

1414
"github.com/runfinch/finch/pkg/mocks"
1515

16-
"github.com/golang/mock/gomock"
1716
"github.com/stretchr/testify/assert"
1817
"github.com/stretchr/testify/require"
18+
"go.uber.org/mock/gomock"
1919
)
2020

2121
func TestNewGenDocsCommand(t *testing.T) {

cmd/finch/main_native_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
"github.com/runfinch/finch/pkg/path"
1919
"github.com/runfinch/finch/pkg/version"
2020

21-
"github.com/golang/mock/gomock"
2221
"github.com/spf13/afero"
2322
"github.com/spf13/cobra"
2423
"github.com/stretchr/testify/assert"
2524
"github.com/stretchr/testify/require"
25+
"go.uber.org/mock/gomock"
2626
)
2727

2828
var nativeConfigStr = ""

cmd/finch/main_remote_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020
"github.com/runfinch/finch/pkg/path"
2121
"github.com/runfinch/finch/pkg/version"
2222

23-
"github.com/golang/mock/gomock"
2423
"github.com/spf13/afero"
2524
"github.com/spf13/cobra"
2625
"github.com/stretchr/testify/assert"
2726
"github.com/stretchr/testify/require"
27+
"go.uber.org/mock/gomock"
2828
)
2929

3030
const remoteConfigStr = `

cmd/finch/nerdctl_darwin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
"strings"
1515
"testing"
1616

17-
"github.com/golang/mock/gomock"
1817
"github.com/spf13/afero"
1918
"github.com/spf13/cobra"
2019
"github.com/stretchr/testify/assert"
2120
"github.com/stretchr/testify/require"
21+
"go.uber.org/mock/gomock"
2222

2323
"github.com/runfinch/finch/pkg/config"
2424
"github.com/runfinch/finch/pkg/flog"

cmd/finch/nerdctl_native_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
"fmt"
1010
"testing"
1111

12-
"github.com/golang/mock/gomock"
1312
"github.com/spf13/afero"
1413
"github.com/spf13/cobra"
1514
"github.com/stretchr/testify/assert"
15+
"go.uber.org/mock/gomock"
1616

1717
"github.com/runfinch/finch/pkg/config"
1818
"github.com/runfinch/finch/pkg/flog"

cmd/finch/nerdctl_remote_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"fmt"
1111
"testing"
1212

13-
"github.com/golang/mock/gomock"
1413
"github.com/spf13/afero"
1514
"github.com/stretchr/testify/assert"
15+
"go.uber.org/mock/gomock"
1616

1717
"github.com/runfinch/finch/pkg/config"
1818
"github.com/runfinch/finch/pkg/mocks"

cmd/finch/nerdctl_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package main
66
import (
77
"testing"
88

9-
"github.com/golang/mock/gomock"
109
"github.com/stretchr/testify/assert"
10+
"go.uber.org/mock/gomock"
1111

1212
"github.com/runfinch/finch/pkg/command"
1313
"github.com/runfinch/finch/pkg/config"

cmd/finch/nerdctl_windows_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
"strings"
1414
"testing"
1515

16-
"github.com/golang/mock/gomock"
1716
"github.com/spf13/afero"
1817
"github.com/spf13/cobra"
1918
"github.com/stretchr/testify/assert"
2019
"github.com/stretchr/testify/require"
20+
"go.uber.org/mock/gomock"
2121

2222
"github.com/runfinch/finch/pkg/config"
2323
"github.com/runfinch/finch/pkg/flog"

cmd/finch/version_native_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414

1515
"github.com/runfinch/finch/pkg/mocks"
1616

17-
"github.com/golang/mock/gomock"
1817
"github.com/stretchr/testify/assert"
1918
"github.com/stretchr/testify/require"
19+
"go.uber.org/mock/gomock"
2020
)
2121

2222
const nerdctlMockVersion = `{

0 commit comments

Comments
 (0)