Skip to content

Commit 193319b

Browse files
committed
mock: add build tag 'testify_no_objx' to opt-out of objx
Add build tag testify_no_objx to allow to exclude method Mock.TestData() for avoiding dependency on github.com/stretchr/objx.
1 parent ad2de5f commit 193319b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

mock/mock_no_objx.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build testify_no_objx || testify_no_deps
2+
3+
package mock
4+
5+
type testData = struct{}

mock/mock_objx.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// maintenance of downstream forks that remove that dependency.
33
// See https://github.com/stretchr/testify/issues/1752
44

5+
//go:build !testify_no_objx && !testify_no_deps
6+
57
package mock
68

79
import "github.com/stretchr/objx"

mock/mock_objx_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !testify_no_objx && !testify_no_deps
2+
13
package mock
24

35
import (

0 commit comments

Comments
 (0)