code: func (f *cacheFile) Close(ctx context.Context, corrupt bool) error {
  	var err error
  	if err = f.File.Close(); err != nil && err != os.ErrClosed {
  		corruptText := ""
  		if corrupt {
  			corruptText = " corrupt"
  		}
  		logging.WithError(err).Warningf(ctx, "failed to close%s cache file", corruptText)
  	} else {
  		err = nil
  	}
  	if corrupt {
  		var err2 error
  		if err2 = f.fs.EnsureFileGone(ctx, f.Name()); err2 != nil {
  			logging.WithError(err2).Warningf(ctx, "failed to delete corrupt cache file")
  		}
  		// only return err2 if err was already nil
  		if err == nil {
  			err = err2
  		}
  	}
  	return err
  }
docs: // Close removes this file from the cache if corrupt is true.
  //
  // This will be true if the cached file is determined to be broken at a higher
  // level.
  //
  // This implements pkg.Source.