package main import ( "fmt" "sync" "time" ) // なんかしらの処理 func someprocess() { somedata := []string{"a", "b", "c", "d", "e"} var wg sync.WaitGroup for _, s := range somedata { wg.Add(1) go func(val string) { defer wg.Done() fmt.Println(val) }(s) } } func main() { // ずっと動き続ける for { someprocess() time.Sleep(3 * time.Second) } } package main import ( "encoding/json" "fmt" "log" "net/http" "os" "sync" "