怎么在go的子路吗下面引用子包下面的函数
我引用子包出现了 build command-line-arguments: cannot load blog/controller/home: malformed module path "blog/controller/home": missing dot in first path element
相关代码
src
blog
controller
home
IndexController.go
main.go
package main
import (
"blog/controller/home" // 这里在goland编辑器编译的时候提升错了
"github.com/kataras/iris"
"github.com/kataras/iris/middleware/logger"
"github.com/kataras/iris/middleware/recover"
"log"
)
func main() {
app := iris.New()
app.Logger().SetLevel("debug")
app.Use(recover.New())
app.Use(logger.New())
app.Get("/", home.Index)
log.Fatal(app.Run(iris.Addr(":8089")))
}
module blog
go 1.13
require (
github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/kataras/iris v0.0.0-20190916050704-df882273e219
github.com/klauspost/compress v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/moul/http2curl v1.0.0 // indirect
github.com/onsi/ginkgo v1.10.2 // indirect
github.com/onsi/gomega v1.7.0 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/valyala/fasthttp v1.5.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.1.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
)
我的go环境都在同一个目录环境下,为什么还报这个错误呢,我的go版本是 go version go1.13.1 darwin/amd64
提示的错误信息是
go: finding github.com/Shopify/goreferrer latest
go: finding github.com/eknkc/amber latest
go: finding github.com/flosch/pongo2 latest
go: finding github.com/kataras/golog latest
go: finding golang.org/x/crypto latest
go: finding github.com/kataras/pio latest
build command-line-arguments: cannot load blog/controller/home: malformed module path "blog/controller/home": missing dot in first path element
请问各位大佬们我哪里写错了呀
这个是ide的问题,或者是可以配置一下idea,可以在项目的左边点击左侧run project,目前我是直接项目左侧目录单独点击run 或者你们也可以修改一下右上角的配置也可以