Simplified file structure
This commit is contained in:
25
src/scanner/Scan.go
Normal file
25
src/scanner/Scan.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user