Exemplo n.º 1
0
// shows stack of all goroutines
func GoroutinesCommand(args []string) {
	goTops := interp.GetInterpreter().GoTops()
	var goNum int
	var err error
	if len(args) > 1 {
		goNum, err = gub.GetInt(args[1],
			"goroutine number", 0, len(goTops)-1)
		if err != nil {
			return
		}
		gub.PrintGoroutine(goNum, goTops)
		return
	}
	for goNum := range goTops {
		gub.PrintGoroutine(goNum, goTops)
	}
}
Exemplo n.º 2
0
func main() {
	i := interp.GetInterpreter()
	fmt.Println(i.Program.PackagesByPath)
}