diff --git a/cmd/fetch.go b/cmd/fetch.go index e18419c..8c839b2 100644 --- a/cmd/fetch.go +++ b/cmd/fetch.go @@ -48,15 +48,16 @@ func worker(id int, furni furniture, respChannel chan<- *http.Response) { return } log.Println("ID :", id, "Fetch page : ", link, "with params : ", furni.Values) + furni.Wg.Add(1) resp, err := furni.Client.PostForm(link, furni.Values) if err != nil { log.Fatal(err) } if resp.StatusCode == 404 { *furni.Kanseru = true + furni.Wg.Done() } else { respChannel <- resp - furni.Wg.Add(1) } }