]> Cypherpunks.ru repositories - goredo.git/blobdiff - targets.go
Redundant @documentencoding
[goredo.git] / targets.go
index af4e4dae9326410a9d0754bcb7851e53f5605e30..5d2342e884ea68f6ac537b85b4dda1b29fcf73c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
 goredo -- djb's redo implementation on pure Go
-Copyright (C) 2020-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2020-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                                        return err
                                }
                                redoFis, err := redoDir.Readdir(0)
+                               redoDir.Close()
                                if err != nil {
                                        return err
                                }
@@ -64,7 +65,6 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                                                tgts[name[:len(name)-len(DepSuffix)]] = struct{}{}
                                        }
                                }
-                               redoDir.Close()
                        } else {
                                if err = targetsCollect(pth, tgts); err != nil {
                                        return err
@@ -72,7 +72,7 @@ func targetsCollect(root string, tgts map[string]struct{}) error {
                        }
                }
        }
-       return dir.Close()
+       return nil
 }
 
 func targetsWalker(tgts []string) ([]string, error) {