Simplified file structure

This commit is contained in:
2024-08-07 19:39:10 +02:00
parent 1b13539b22
commit 66569446b1
219 changed files with 453 additions and 457 deletions

25
src/scanner/Scan.go Normal file
View File

@ -0,0 +1,25 @@
package scanner
import (
"git.akyoto.dev/cli/q/src/core"
"git.akyoto.dev/cli/q/src/fs"
)
// Scan scans the list of files.
func Scan(files []string) (<-chan *fs.File, <-chan *core.Function, <-chan error) {
scanner := Scanner{
files: make(chan *fs.File),
functions: make(chan *core.Function),
errors: make(chan error),
}
go func() {
scanner.queue(files...)
scanner.group.Wait()
close(scanner.files)
close(scanner.functions)
close(scanner.errors)
}()
return scanner.files, scanner.functions, scanner.errors
}