This commit is contained in:
parent
9b51680af5
commit
c2b8db238e
24 changed files with 624 additions and 232 deletions
21
src/scanner/queue.go
Normal file
21
src/scanner/queue.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package scanner
|
||||
|
||||
import "os"
|
||||
|
||||
// queue scans the list of files.
|
||||
func (s *scanner) queue(files ...string) {
|
||||
for _, file := range files {
|
||||
stat, err := os.Stat(file)
|
||||
|
||||
if err != nil {
|
||||
s.errors <- err
|
||||
return
|
||||
}
|
||||
|
||||
if stat.IsDir() {
|
||||
s.queueDirectory(file, "main")
|
||||
} else {
|
||||
s.queueFile(file, "main")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue