[root@host up]# ./main
[ORM]2018/10/02 01:48:15 register db Ping `default`, Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
must have one register DataBase alias named `default`
[root@host up]#
beego写的web应用,在Mac OS下交叉编译出Linux版本,无法执行。打开CGO之后无法编译通过,这是什么原因?
go-sqlite3是否只能在Linux上安装go环境然后编译?
mac上交叉编译linux的参数:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
你填对了吗?