func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bool {
fd, err := os.Open(path)
- defer fd.Close()
if err != nil {
log.Fatalln("Can not open file:", err)
}
+ defer fd.Close()
var metaPkt nncp.ChunkedMeta
les := nncp.LEs{{K: "Path", V: path}}
logMsg := func(les nncp.LEs) string {
func findMetas(ctx *nncp.Ctx, dirPath string) []string {
dir, err := os.Open(dirPath)
- defer dir.Close()
logMsg := func(les nncp.LEs) string {
return "Finding .meta in " + dirPath
}
ctx.LogE("reass", nncp.LEs{{K: "Path", V: dirPath}}, err, logMsg)
return nil
}
+ defer dir.Close()
fis, err := dir.Readdir(0)
dir.Close()
if err != nil {