func GenWorkers(num int) chan<- func() {
	tasks := make(chan func())
	for i := 0; i < num; i++ {
		go func() {
			for f := range tasks {
				f()
			}
		}()
	}
	return tasks
}
GenWorkers generate workers
package util
import (
	"os"
	"path/filepath"
	"runtime"
	"github.com/inconshreveable/log15"
	"golang.org/x/xerrors"
)