本文整理匯總了Golang中github.com/derekparker/delve/service.Client.ListGoroutines方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.ListGoroutines方法的具體用法?Golang Client.ListGoroutines怎麽用?Golang Client.ListGoroutines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/derekparker/delve/service.Client
的用法示例。
在下文中一共展示了Client.ListGoroutines方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: goroutines
func goroutines(client service.Client, args ...string) error {
gs, err := client.ListGoroutines()
if err != nil {
return err
}
fmt.Printf("[%d goroutines]\n", len(gs))
for _, g := range gs {
fmt.Printf("Goroutine %s\n", formatGoroutine(g))
}
return nil
}
示例2: goroutines
func goroutines(client service.Client, args ...string) error {
gs, err := client.ListGoroutines()
if err != nil {
return err
}
fmt.Printf("[%d goroutines]\n", len(gs))
for _, g := range gs {
var fname string
if g.Function != nil {
fname = g.Function.Name
}
fmt.Printf("Goroutine %d - %s:%d %s (%#v)\n", g.ID, g.File, g.Line, fname, g.PC)
}
return nil
}
示例3: goroutines
func goroutines(client service.Client, args ...string) error {
state, err := client.GetState()
if err != nil {
return err
}
gs, err := client.ListGoroutines()
if err != nil {
return err
}
fmt.Printf("[%d goroutines]\n", len(gs))
for _, g := range gs {
prefix := " "
if g.ID == state.SelectedGoroutine.ID {
prefix = "* "
}
fmt.Printf("%sGoroutine %s\n", prefix, formatGoroutine(g))
}
return nil
}