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.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ee028af4-3de2-468c-9ef2-48d8a2ac24cbn%40googlegroups.com.

Reply via email to