Closed
Description
I can't run the following code
import "fmt"
type person struct{
first string
last string
}
func (s person) speak() {
fmt.Println("I am", s.first, s.last)
}
p1 := person{
first: "xdays",
last: "chen",
}
fmt.Println(p1)
p1.speak()
and the error messge is:
repl.go:60:1: not a package: "p1" in p1.speak <*ast.SelectorExpr>
here's result from play.golang.org https://play.golang.org/p/3MUTTha849C