Allenxuxu / mogutouERP

轻进存销管理系统

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

你好,编译的时候出现报错

zjjacky opened this issue · comments

go build -o mogutou main.go router.go
router.go:4:2: cannot find package "github.com/Allenxuxu/mogutouERP/api" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/api (from $GOROOT)
/Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/api (from $GOPATH)
router.go:5:2: cannot find package "github.com/Allenxuxu/mogutouERP/middleware" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/middleware (from $GOROOT)
/Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/middleware (from $GOPATH)
main.go:7:2: cannot find package "github.com/Allenxuxu/mogutouERP/tree/master/models" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/tree/master/models (from $GOROOT)
/Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/tree/master/models (from $GOPATH)
main.go:8:2: cannot find package "github.com/Allenxuxu/mogutouERP/tree/master/pkg/token" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/Allenxuxu/mogutouERP/tree/master/pkg/token (from $GOROOT)
/Users/jacky/go/src/github.com/Allenxuxu/mogutouERP/tree/master/pkg/token (from $GOPATH)
router.go:6:2: cannot find package "github.com/gin-contrib/cors" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/gin-contrib/cors (from $GOROOT)
/Users/jacky/go/src/github.com/gin-contrib/cors (from $GOPATH)
main.go:9:2: cannot find package "github.com/gin-gonic/gin" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/gin-gonic/gin (from $GOROOT)
/Users/jacky/go/src/github.com/gin-gonic/gin (from $GOPATH)
main.go:10:2: cannot find package "github.com/jinzhu/gorm/dialects/mysql" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/jinzhu/gorm/dialects/mysql (from $GOROOT)
/Users/jacky/go/src/github.com/jinzhu/gorm/dialects/mysql (from $GOPATH)
main.go:11:2: cannot find package "github.com/micro/go-micro/config" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/micro/go-micro/config (from $GOROOT)
/Users/jacky/go/src/github.com/micro/go-micro/config (from $GOPATH)
main.go:12:2: cannot find package "github.com/micro/go-micro/config/source/file" in any of:
/usr/local/Cellar/go/1.13.4/libexec/src/github.com/micro/go-micro/config/source/file (from $GOROOT)
/Users/jacky/go/src/github.com/micro/go-micro/config/source/file (from $GOPATH)
make: *** [build] Error 1

google了一下没找到解决办法,请问怎么弄?macos下的go环境
谢谢

GOPATH 不对,自己把路径放对就可以。

最近,我尽量抽空把这个仓库改成 go mod 的吧,或者 你可以帮我改下,然后 PR。

我。。。。。。。我不会go啊 因为刚好看到这个项目,我正好试下部署go 刚又出了个错 2019-12-12 16:35:32] Error 1067: Invalid default value for 'state'
panic: Error 1146: Table 'mgt.custormer_orders' doesn't exist
是不是数据局没有初始化到这个表呢

我。。。。。。。我不会go啊 因为刚好看到这个项目,我正好试下部署go 刚又出了个错 2019-12-12 16:35:32] Error 1067: Invalid default value for 'state'
panic: Error 1146: Table 'mgt.custormer_orders' doesn't exist
是不是数据局没有初始化到这个表呢

应该是你 mysql 的版本问题, 试试 mysql 5.7

我是docker pull的最新的mysql 版本是5.7.18

我是docker pull的最新的mysql 版本是5.7.18

你 create db 的时候指定 utf8, 可能是因为我给 state 设置的默认值是中文

好的。我重新试试make run

啊好了啊,谢谢啦

啊好了啊,谢谢啦

😊 不客气