testify/mock/mock_objx.go
Olivier Mengué 580d807112 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.
2025-08-25 14:13:40 +02:00

22 lines
573 B
Go

// This source file isolates the uses of the objx module to ease
// maintenance of downstream forks that remove that dependency.
// See https://github.com/stretchr/testify/issues/1752
//go:build !testify_no_objx && !testify_no_deps
package mock
import "github.com/stretchr/objx"
type testData = objx.Map
// TestData holds any data that might be useful for testing. Testify ignores
// this data completely allowing you to do whatever you like with it.
func (m *Mock) TestData() objx.Map {
if m.testData == nil {
m.testData = make(objx.Map)
}
return m.testData
}