SetModTime sets the metadata on the DirEntry to set the modification date If there is any other metadata it does not overwrite it.
(ctx context.Context, t time.Time)
| 256 | // |
| 257 | // If there is any other metadata it does not overwrite it. |
| 258 | func (d *Directory) SetModTime(ctx context.Context, t time.Time) error { |
| 259 | entries, err := d.fs.actionEntries(d.candidates()...) |
| 260 | if err != nil { |
| 261 | return err |
| 262 | } |
| 263 | var wg sync.WaitGroup |
| 264 | errs := Errors(make([]error, len(entries))) |
| 265 | multithread(len(entries), func(i int) { |
| 266 | if d, ok := entries[i].(*upstream.Directory); ok { |
| 267 | err := d.SetModTime(ctx, t) |
| 268 | if err != nil { |
| 269 | errs[i] = fmt.Errorf("%s: %w", d.UpstreamFs().Name(), err) |
| 270 | } |
| 271 | } else { |
| 272 | errs[i] = fs.ErrorIsFile |
| 273 | } |
| 274 | }) |
| 275 | wg.Wait() |
| 276 | return errs.Err() |
| 277 | } |
| 278 | |
| 279 | // Check the interfaces are satisfied |
| 280 | var ( |
nothing calls this directly
no test coverage detected