X-Git-Url: http://www.git.cypherpunks.ru/?p=nncp.git;a=blobdiff_plain;f=src%2Fcmd%2Fnncp-bundle%2Fmain.go;h=6fa0ab3642489d76fa04cf22d693c73c45f31cb1;hp=e00da48002f49efe3c19c4d39b1684ab4daeb8c8;hb=72f42f8288689ae89e021ba33ebca8d551a784d7;hpb=beefc4fd7137435caf9c653633ab938947df07f8 diff --git a/src/cmd/nncp-bundle/main.go b/src/cmd/nncp-bundle/main.go index e00da48..6fa0ab3 100644 --- a/src/cmd/nncp-bundle/main.go +++ b/src/cmd/nncp-bundle/main.go @@ -26,6 +26,7 @@ import ( "flag" "fmt" "io" + "io/fs" "log" "os" "path/filepath" @@ -407,7 +408,7 @@ func main() { } 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" }) @@ -415,7 +416,7 @@ func main() { } 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" })