This commit is contained in:
parent
df92f55df6
commit
154893d9f7
19 changed files with 410 additions and 11 deletions
|
@ -2,9 +2,23 @@ package scanner
|
|||
|
||||
import (
|
||||
"git.urbach.dev/cli/q/src/build"
|
||||
"git.urbach.dev/cli/q/src/fs"
|
||||
)
|
||||
|
||||
// Scan scans all the files included in the build.
|
||||
func Scan(b *build.Build) Result {
|
||||
return Result{}
|
||||
func Scan(b *build.Build) (<-chan *fs.File, <-chan error) {
|
||||
s := scanner{
|
||||
files: make(chan *fs.File),
|
||||
errors: make(chan error),
|
||||
build: b,
|
||||
}
|
||||
|
||||
go func() {
|
||||
s.queue(b.Files...)
|
||||
s.group.Wait()
|
||||
close(s.files)
|
||||
close(s.errors)
|
||||
}()
|
||||
|
||||
return s.files, s.errors
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue