Improved error handling

This commit is contained in:
Eduard Urbach 2023-11-03 10:42:10 +01:00
parent 8de28852cd
commit b72e3943a4
Signed by: eduard
GPG key ID: 49226B848C78F6C8
3 changed files with 10 additions and 15 deletions

View file

@ -28,7 +28,7 @@ func Scan(path string) (<-chan *Function, <-chan error) {
func scan(path string, functions chan<- *Function, errors chan<- error) {
wg := sync.WaitGroup{}
directory.Walk(path, func(name string) {
err := directory.Walk(path, func(name string) {
if !strings.HasSuffix(name, ".q") {
return
}
@ -46,6 +46,10 @@ func scan(path string, functions chan<- *Function, errors chan<- error) {
}()
})
if err != nil {
errors <- err
}
wg.Wait()
}