良いウェブ無効なリンクチェッカーが見つかりました。しかし、ゴルーチンを使って完全なサンプルを変更するには?ウェブページはHow To Crawl A Website In Golangです。コードは、検索されるURLをpendingスライスに動的に追加します。私はそれをするためにgoroutineを使用するいくつかの困難があります。 package main
import (
"cryp
私はgoroutines、チャンネルなどに慣れています。 for _, h := range hosts {
go func() {
httpClient := cleanhttp.DefaultPooledClient()
// format the URL with the passed host and por
url := fmt.Spr
迷惑な問題に直面しています。 wg.Add()を使用してルーチンを同期しようとすると、デッドロックエラーが発生します。 package main
import (
"fmt"
"sync"
)
func hello(ch chan int, num int, wg *sync.WaitGroup) {
for {
i := <-ch
i