Improved error handling
This commit is contained in:
parent
8de28852cd
commit
b72e3943a4
3 changed files with 10 additions and 15 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue