Skip to content

Commit 21f0aed

Browse files
authored
chore: add go tool (#1168)
* chore: add go tool * fix tests * optimize
1 parent a4a1e40 commit 21f0aed

4 files changed

Lines changed: 4 additions & 39 deletions

File tree

.github/workflows/mockery.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
go-version: 'stable'
1616
- name: Generate Mocks
17-
run: go run github.com/vektra/mockery/v2
17+
run: go tool mockery
1818
- uses: stefanzweifel/git-auto-commit-action@v6
1919
name: Commit changes
2020
with:

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ require (
3030
github.com/spf13/viper v1.20.1
3131
github.com/stretchr/testify v1.10.0
3232
github.com/urfave/cli/v3 v3.4.1
33-
github.com/vektra/mockery/v2 v2.53.2
3433
golang.org/x/crypto v0.41.0
3534
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6
3635
google.golang.org/grpc v1.74.2
@@ -96,6 +95,7 @@ require (
9695
github.com/spf13/pflag v1.0.6 // indirect
9796
github.com/stretchr/objx v0.5.2 // indirect
9897
github.com/subosito/gotenv v1.6.0 // indirect
98+
github.com/vektra/mockery/v2 v2.53.2 // indirect
9999
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
100100
github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342
101101
go.uber.org/multierr v1.11.0 // indirect
@@ -115,3 +115,5 @@ replace (
115115
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20250811230008-5f3141c8851a
116116
google.golang.org/genproto/googleapis/rpc => google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a
117117
)
118+
119+
tool github.com/vektra/mockery/v2

support/file/file_test.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,6 @@ func TestGetContent(t *testing.T) {
7575
assert.Contains(t, content, "Version")
7676
}
7777

78-
func TestGetFrameworkContent(t *testing.T) {
79-
// Test successful case - reading a known framework file
80-
content, err := GetFrameworkContent("support/constant.go")
81-
assert.Nil(t, err)
82-
assert.NotEmpty(t, content)
83-
assert.Contains(t, content, "Version")
84-
85-
// Test successful case - reading another framework file
86-
content, err = GetFrameworkContent("support/file/file.go")
87-
assert.Nil(t, err)
88-
assert.NotEmpty(t, content)
89-
assert.Contains(t, content, "package file")
90-
91-
// Test case with non-existent file
92-
content, err = GetFrameworkContent("non/existent/file.go")
93-
assert.NotNil(t, err)
94-
assert.Empty(t, content)
95-
96-
// Test case with empty file path
97-
content, err = GetFrameworkContent("")
98-
assert.NotNil(t, err)
99-
assert.Empty(t, content)
100-
101-
// Test case with file path that contains expected framework content
102-
content, err = GetFrameworkContent("go.mod")
103-
assert.Nil(t, err)
104-
assert.NotEmpty(t, content)
105-
assert.Contains(t, content, "module github.com/goravel/framework")
106-
}
107-
10878
func TestPutContent(t *testing.T) {
10979
if !env.IsWindows() {
11080
// directory creation failure

tool.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)