pkg/blobcache: simplify test case#2521
Conversation
1. Use os.ReadDir to remove a few lines of code. 2. Don't wrap errors from os, they already contain file name. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
From the review comments in #2515 I found out we want to keep wrapping os errors, since the file name component in os.PathError is not being quoted when converting to a string. Yet this is a test case code, in which file names are predictable, and all errors have additional context (source file name and line number), which makes it easier to figure out what has happened, so I took the liberty of keeping the part of the original patch which removes os error wrapping. |
ACK. (Really the typical c/image approach is to use |
Based on a patch from #2512.
Use os.ReadDir to remove a few lines of code.
Don't wrap errors from os, they already contain file name.