$ dlv debug main.go
Type 'help' for list of commands.
(dlv)
# 針對function
(dlv) b main.main
Breakpoint 1 set at 0x4a26a8 for main.main() ./main.go:12
# 針對程式的第幾行
(dlv) b main.go:12
Breakpoint 1 set at 0x4a26a8 for main.main() ./main.go:12
(dlv) c
> main.main() ./main.go:12 (hits goroutine(1):1 total:1) (PC: 0x4a26a8)
7: func printName(name string) {
8: fmt.Printf("I'm %s\n", name)
9: }
10:
11:
=> 12: func main() {
13: name := "HaHa"
14: fmt.Printf("Hello %s!\n", name)
15: printName(name)
16: }