delve/_fixtures/locationsprog.go
aarzilli 8e8d2660ef Improve commands which take a location spec
Breakpoints, tracepoints, etc.. take a location spec as input. This
patch improves the expressiveness of that API. It allows:

* Breakpoint at line
* Breakpoint at function (handling package / receiver smoothing)
* Breakpoint at address
* Breakpoint at file:line
* Setting breakpoint based off regexp
2015-08-08 14:41:48 -05:00

36 lines
495 B
Go

package main
import (
"fmt"
)
type SomeType struct {
}
type OtherType struct {
}
func (a *SomeType) String() string {
return "SomeTypeObject"
}
func (a *OtherType) String() string {
return "OtherTypeObject"
}
func (a *SomeType) SomeFunction() {
fmt.Printf("SomeFunction called\n")
}
func anotherFunction() {
fmt.Printf("anotherFunction called\n")
}
func main() {
var a SomeType
var b OtherType
fmt.Printf("%s %s\n", a.String(), b.String())
a.SomeFunction()
anotherFunction()
}