_, table := range tables { wg.Add(1) go func(table string) { sem <- 1 defer wg.Done() defer func() { <-sem }() session, err := conn.NewSession() if err != nil { panic("Failed to create session: " + err.Error()) } defer session.Close() var fetchTableStdoutBuf bytes.Buffer session.Stdout = &fetchTableStdoutBuf fetchRowsCmd := fmt.Sprintf(SelectTablesCmd, srcDBConf.User, srcDBConf.Password, srcDBConf.Name, table) err = session.Run(fetchRowsCmd) MySQL1ΫΤϦΛΑ͠ͳʹϚ ϧνίΞͰͬͯ͘ΕΔΈ ͕ͳ͍ͷͰɺμϯϓ/ϦετΞΛ goroutineͰฒྻԽ͢Δ͜ͱͰɺ
γϡοͱσʔλΛऔͬͯ͜Ε· ͢ɻ