"flag"
"fmt"
"io"
- "io/ioutil"
+ "io/fs"
"log"
"os"
"path/filepath"
}
dstDirPath := filepath.Join(ctx.Spool, sender, string(nncp.TRx))
dstPath := filepath.Join(dstDirPath, pktName)
- if _, err = os.Stat(dstPath); err == nil || !os.IsNotExist(err) {
+ if _, err = os.Stat(dstPath); err == nil || !errors.Is(err, fs.ErrNotExist) {
ctx.LogD("bundle-rx-exists", les, func(les nncp.LEs) string {
return logMsg(les) + ": packet already exists"
})
}
if _, err = os.Stat(filepath.Join(
dstDirPath, nncp.SeenDir, pktName,
- )); err == nil || !os.IsNotExist(err) {
+ )); err == nil || !errors.Is(err, fs.ErrNotExist) {
ctx.LogD("bundle-rx-seen", les, func(les nncp.LEs) string {
return logMsg(les) + ": packet already seen"
})
}
} else {
if *dryRun {
- if _, err = nncp.CopyProgressed(ioutil.Discard, tarR, "Rx", les, ctx.ShowPrgrs); err != nil {
+ if _, err = nncp.CopyProgressed(io.Discard, tarR, "Rx", les, ctx.ShowPrgrs); err != nil {
log.Fatalln("Error during copying:", err)
}
} else {