Golang - Why can't I import local package in GOPATH/src/project but can in home directory?

前端 未结 2 1711
遇见更好的自我
遇见更好的自我 2021-01-18 21:40

I have a project, its folder structure is like following:

    /project
        models/
            Product.go
        main.go

The content o

2条回答
  •  日久生厌
    2021-01-18 22:06

    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".

提交回复
热议问题