Added a check for unused imports

This commit is contained in:
Eduard Urbach 2024-07-31 11:55:21 +02:00
parent 9ea99c97c4
commit 2d905c1ac0
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 138 additions and 31 deletions

View file

@ -1,10 +1,14 @@
package scanner
import "git.akyoto.dev/cli/q/src/build/core"
import (
"git.akyoto.dev/cli/q/src/build/core"
"git.akyoto.dev/cli/q/src/build/fs"
)
// Scan scans the list of files.
func Scan(files []string) (<-chan *core.Function, <-chan error) {
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),
}
@ -12,9 +16,10 @@ func Scan(files []string) (<-chan *core.Function, <-chan error) {
go func() {
scanner.queue(files...)
scanner.group.Wait()
close(scanner.files)
close(scanner.functions)
close(scanner.errors)
}()
return scanner.functions, scanner.errors
return scanner.files, scanner.functions, scanner.errors
}