@@ -222,45 +222,3 @@ func isValidCache(cache *TestCache, testFile string, content []byte) bool {
222
222
223
223
return true
224
224
}
225
-
226
- // loadTestFileCache loads the cached test results for all test functions in a file
227
- func loadTestFileCache (testFile string , content []byte ) (* TestFileCache , error ) {
228
- cacheFile , err := cacheFilePath (testFile )
229
- if err != nil {
230
- return nil , err
231
- }
232
-
233
- data , err := os .ReadFile (cacheFile )
234
- if err != nil {
235
- if os .IsNotExist (err ) {
236
- return & TestFileCache {Tests : make (map [string ]* TestFuncCache )}, nil
237
- }
238
- return nil , fmt .Errorf ("failed to read cache file: %w" , err )
239
- }
240
-
241
- var cache TestFileCache
242
- if err := json .Unmarshal (data , & cache ); err != nil {
243
- return nil , fmt .Errorf ("failed to unmarshal cache: %w" , err )
244
- }
245
-
246
- return & cache , nil
247
- }
248
-
249
- // saveTestFileCache saves the test results for all test functions in a file
250
- func saveTestFileCache (testFile string , cache * TestFileCache ) error {
251
- cacheFile , err := cacheFilePath (testFile )
252
- if err != nil {
253
- return err
254
- }
255
-
256
- data , err := json .Marshal (cache )
257
- if err != nil {
258
- return fmt .Errorf ("failed to marshal cache: %w" , err )
259
- }
260
-
261
- if err := os .WriteFile (cacheFile , data , 0o644 ); err != nil {
262
- return fmt .Errorf ("failed to write cache file: %w" , err )
263
- }
264
-
265
- return nil
266
- }
0 commit comments