WithReadonlyTempMount mounts the provided mounts to a temp dir as readonly, and pass the temp dir to f. The mounts are valid during the call to the f. Finally we will unmount and remove the temp dir regardless of the result of f.
(ctx context.Context, mounts []Mount, f func(root string) error)
| 135 | // and pass the temp dir to f. The mounts are valid during the call to the f. |
| 136 | // Finally we will unmount and remove the temp dir regardless of the result of f. |
| 137 | func WithReadonlyTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { |
| 138 | return WithTempMount(ctx, readonlyMounts(mounts), f) |
| 139 | } |
| 140 | |
| 141 | func getTempDir() string { |
| 142 | if xdg := os.Getenv("XDG_RUNTIME_DIR"); xdg != "" { |
no test coverage detected
searching dependent graphs…