I import a struct defined in another package, when try to use it to construct a literal, get a "not a type" error.
In publish.go
type Book struct {
Name string
Author string
Published bool
}
In store.go
import "publish"
func Init() {
var reading publish.Book
b := &reading {
Name: "Learn Go Lang",
Author: "Rob",
Published: true
}
}
Error: reading is not a type