I filed a bug for this over at the delve site. So, to explain what's going on. I have 2 files in the same package, main.go and common.go. In main.go, it uses some structure from common.go and when i run
dlv debug --listen=:2345 --headless --api-version=2 --log main.go
it fails with 'undefined: NewSimpleStruct' and i am not sure what i am doing wrong.
Here's what the Go files contain,
//main.go
package main
import (
"fmt"
)
func main() {
fmt.Println("HELLO WORLD!")
segasaturn := NewSimpleStruct("SS", 69)
segasaturn.WhoAmI()
fmt.Println("BYE WORLD!")
}
//common.go
package main
import "fmt"
type simpleStruct struct {
name string
id int
}
func NewSimpleStruct(name string, id int) *simpleStruct {
return &simpleStruct{name, id}
}
func (ss *simpleStruct) WhoAmI() {
fmt.Printf("name: %s, id: %d
", ss.name, ss.id)
}