I have a project, its folder structure is like following:
/project
models/
Product.go
main.go
The content o
Relative import paths are only allowed as a convenience, mostly for experimentation. They are not fully supported by go build
and go install
. If you want your package to work with the go
tools, don't use relative imports. Structure your code as described in How to Write Go Code.
As you are using "github.com/gin-gonic/gin" in your code. It is an external import. So go compiler will try to find this package in your workspace. So you need manually download those package in your go workspace or build path "go get github.com/gin-gonic/gin".