Implemented a basic scanner
All checks were successful
/ test (push) Successful in 17s

This commit is contained in:
Eduard Urbach 2025-06-19 15:17:50 +02:00
parent df92f55df6
commit 154893d9f7
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
19 changed files with 410 additions and 11 deletions

View file

@ -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
}