func initGoToolPath() {
	toolPath := strings.TrimRight(strings.Replace(os.Getenv("GOROOT"), `\`, `/`, -1), "/") + "/pkg/tool/"
	goToolPath := toolPath + runtime.GOOS + "_" + runtime.GOARCH

	filepath.Walk(goToolPath, func(path string, info fs.FileInfo, err error) error {
		if strings.HasPrefix(info.Name(), "pprof") {
			pprofExePath = path
		} else if strings.HasPrefix(info.Name(), "trace") {
			traceExePath = path
		}
		return nil
	})

	if pprofExePath == "" {
		log.Fatalf("pprof not found in %v\n", goToolPath)
	}

	if traceExePath == "" {
		log.Fatalf("trace not found in %v\n", goToolPath)
	}
}
// initGoToolPath find the path for pprof and trace.
initGoToolPath find the path for pprof and trace.
// initGoToolPath find the path for pprof and trace .
func initGoToolPath() {
	toolPath := strings.TrimRight(strings.Replace(os.Getenv("GOROOT"), `\`, `/`, -1), "/") + "/pkg/tool/"
	goToolPath := toolPath + runtime.GOOS + "_" + runtime.GOARCH
	filepath.Walk(goToolPath, func(path string, info fs.FileInfo, err error) error {
		if strings.HasPrefix(info.Name(), "pprof") {
			pprofExePath = path
		} else if strings.HasPrefix(info.Name(), "trace") {
			traceExePath = path
		}
		return nil
	})
	if pprofExePath == "" {
		log.Fatalf("pprof not found in %v\n", goToolPath)
	}
	if traceExePath == "" {
		log.Fatalf("trace not found in %v\n", goToolPath)
	}
}
func initGoToolPath ( ) { toolPath := strings . TrimRight ( strings . Replace ( os . Getenv ( " " ) , `\` , `/` , - 1 ) , " " ) + " " goToolPath := toolPath + runtime . GOOS + " " + runtime . GOARCH filepath . Walk ( goToolPath , func ( path string , info fs . FileInfo , err error ) error { if strings . HasPrefix ( info . Name ( ) , " " ) { pprofExePath = path } else if strings . HasPrefix ( info . Name ( ) , " " ) { traceExePath = path } return nil } ) if pprofExePath == " " { log . Fatalf ( " \n " , goToolPath ) } if traceExePath == " " { log . Fatalf ( " \n " , goToolPath ) } }
initGoToolPath find the path for pprof and trace.
initGoToolPath find the path for pprof and trace .