This is really a go module 101 question, as I'm trying to understand and solve the undefined types problem that I'm having.
I have:
$ head -1 go.mod
module backend
And in my internal/petstore/main.go file, I have:
package main
import api "backend/internal/petstore/interfaces/ports"
func main() {
petStore := api.NewPetStore()
}
And in my internal/petstore/interfaces/ports/type.go file, I have:
package api
type PetStore struct {...}
I think it should compile, but I'm getting:
$ go run internal/petstore/main.go
# command-line-arguments
internal/petstore/main.go:..:38: undefined: api.PetStore
and I have no idea how to fix it.
I also tried to build the whole project with `go build .`, but got
no Go files in <my project root folder>
Please help. thx.