We need `chmod -R` to be able to cleanup after Go packages, but it's unnecessary in most other cases. By only running it when the first `rm -rf` fails, we optimize for the most common case and get a tiny speedup for this build step.
We need `chmod -R` to be able to cleanup after Go packages, but it's unnecessary in most other cases. By only running it when the first `rm -rf` fails, we optimize for the most common case and get a tiny speedup for this build step.