delve/_fixtures/locationsprog.go
Alessandro Arzilli 9bc6ad4f46 Go 1.7 compatibility (#524)
* tests: update to cope with go1.7 SSA compiler

* de-vendored golang.org/x/debug/dwarf

We need our own tweaked version

* dwarf/debug/dwarf: always use the entry's name attribute

Using the name attribute leads to better type names as well as fixes
inconsistencies between 1.5, 1.6 and 1.7.

* proc: Updated loadInterface to work with go1.7

go1.7 changed the internal representation of types, removing the string
field from runtime._type.
Updated loadInterface to use the new str field.
2016-05-29 12:20:09 -07:00

39 lines
564 B
Go

package main
import (
"fmt"
"io/ioutil"
)
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
i := 10
fmt.Printf("%s %s %v\n", a.String(), b.String(), i)
a.SomeFunction()
anotherFunction()
ioutil.ReadFile("nonexistent.file.txt")
}