Implemented function scanning
All checks were successful
/ test (push) Successful in 16s

This commit is contained in:
Eduard Urbach 2025-06-19 23:31:52 +02:00
parent 9b51680af5
commit c2b8db238e
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
24 changed files with 624 additions and 232 deletions

View file

@ -2,23 +2,26 @@ package scanner
import (
"git.urbach.dev/cli/q/src/build"
"git.urbach.dev/cli/q/src/core"
"git.urbach.dev/cli/q/src/fs"
)
// Scan scans all the files included in the build.
func Scan(b *build.Build) (<-chan *fs.File, <-chan error) {
func Scan(b *build.Build) (<-chan *core.Function, <-chan *fs.File, <-chan error) {
s := scanner{
files: make(chan *fs.File),
errors: make(chan error),
build: b,
functions: make(chan *core.Function),
files: make(chan *fs.File),
errors: make(chan error),
build: b,
}
go func() {
s.queue(b.Files...)
s.group.Wait()
close(s.functions)
close(s.files)
close(s.errors)
}()
return s.files, s.errors
return s.functions, s.files, s.errors
}