@@ -83,6 +83,8 @@ func (e *EnvT) T() T {
83
83
// opt - fixture options, nil for default options.
84
84
// f - callback - fixture body.
85
85
// Cache guarantee for call f exactly once for same Cache called and params combination.
86
+ // Deprecated: will be removed in next versions.
87
+ // Use EnvT.CacheResult instead
86
88
func (e * EnvT ) Cache (cacheKey interface {}, opt * FixtureOptions , f FixtureCallbackFunc ) interface {} {
87
89
return e .cache (cacheKey , opt , f )
88
90
}
@@ -99,6 +101,8 @@ func (e *EnvT) Cache(cacheKey interface{}, opt *FixtureOptions, f FixtureCallbac
99
101
// f - callback - fixture body.
100
102
// cleanup, returned from f called while fixture cleanup
101
103
// Cache guarantee for call f exactly once for same Cache called and params combination.
104
+ // Deprecated: will be removed in next versions.
105
+ // Use EnvT.CacheResult instead
102
106
func (e * EnvT ) CacheWithCleanup (cacheKey interface {}, opt * FixtureOptions , f FixtureCallbackWithCleanupFunc ) interface {} {
103
107
if opt == nil {
104
108
opt = & FixtureOptions {}
@@ -119,6 +123,9 @@ func (e *EnvT) CacheWithCleanup(cacheKey interface{}, opt *FixtureOptions, f Fix
119
123
return e .cache (cacheKey , opt , fWithoutCleanup )
120
124
}
121
125
126
+ // CacheResult call f callback once and cache result (ok and error),
127
+ // then return same result for all calls of the callback without additional calls
128
+ // f with same options calls max once per test (or defined test scope)
122
129
func (e * EnvT ) CacheResult (f FixtureFunction , options ... CacheOptions ) interface {} {
123
130
var cacheOptions CacheOptions
124
131
switch len (options ) {
0 commit comments