We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fd803a commit 6a84917Copy full SHA for 6a84917
internal/testing/exp/fixture/fixture.go
@@ -125,13 +125,21 @@ func (f FixtureSetup[T]) setup(val reflect.Value) Setuper {
125
}
126
setups.append(f.setup(val.FieldByIndex(field.Index)))
127
128
- if setup, ok := val.Interface().(Setuper); ok {
+ actualVal := val.Interface()
129
+ if setup, ok := actualVal.(Setuper); ok {
130
setups.append(setup)
131
} else if val.CanAddr() {
132
if setup, ok := val.Addr().Interface().(Setuper); ok {
133
134
135
136
+ if init, ok := actualVal.(FixtureInit); ok {
137
+ init.SetTB(f.TB)
138
+ } else if val.CanAddr() {
139
+ if init, ok := val.Addr().Interface().(FixtureInit); ok {
140
141
+ }
142
143
// var res *NullSetup
144
return setups
145
0 commit comments