升级go1.10后打包出错

小白请教:


之前1.8和1.9都正常,今天升级到1.10发现打包出来的执行文件运行报错 在mac和win10打包成linux bee pack -be=GOOS=linux 运行时:

panic: you are in dev mode. So please set gopath

goroutine 1 [running]:
github.com/astaxie/beego.(*ControllerRegister).Include(0xc4200c0790, 0xc4201dfc30, 0x1, 0x1)
    E:/m/go/src/github.com/astaxie/beego/router.go:231 +0x789
github.com/astaxie/beego.(*Namespace).Include(0xc4202290a0, 0xc4201dfc30, 0x1, 0x1, 0xc4202290a0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:186 +0x4d
github.com/astaxie/beego.NSInclude.func1(0xc4202290a0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:302 +0x46
github.com/astaxie/beego.NewNamespace(0xaae8aa, 0x9, 0xc42008d388, 0x1, 0x1, 0xc420231101)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
github.com/astaxie/beego.NSNamespace.func1(0xc420229080)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:386 +0x52
github.com/astaxie/beego.NewNamespace(0xaae88f, 0x9, 0xc420183e98, 0x18, 0x18, 0xc420231170)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
aaa-api/routers.init.1()
    E:/m/go/src/aaa-api/routers/router.go:20 +0x17f4
panic: you are in dev mode. So please set gopath

goroutine 1 [running]:
github.com/astaxie/beego.(*ControllerRegister).Include(0xc4200c0840, 0xc4201dfc30, 0x1, 0x1)
    E:/m/go/src/github.com/astaxie/beego/router.go:231 +0x789
github.com/astaxie/beego.(*Namespace).Include(0xc42022b0c0, 0xc4201dfc30, 0x1, 0x1, 0xc42022b0c0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:186 +0x4d
github.com/astaxie/beego.NSInclude.func1(0xc42022b0c0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:302 +0x46
github.com/astaxie/beego.NewNamespace(0xaae8aa, 0x9, 0xc42008d388, 0x1, 0x1, 0xc420235101)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
github.com/astaxie/beego.NSNamespace.func1(0xc42022b0a0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:386 +0x52
github.com/astaxie/beego.NewNamespace(0xaae88f, 0x9, 0xc420185e98, 0x18, 0x18, 0xc420235170)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
aaa-api/routers.init.1()
    E:/m/go/src/aaa-api/routers/router.go:20 +0x17f4
panic: you are in dev mode. So please set gopath

goroutine 1 [running]:
github.com/astaxie/beego.(*ControllerRegister).Include(0xc4200ae6e0, 0xc4201cbc60, 0x1, 0x1)
    E:/m/go/src/github.com/astaxie/beego/router.go:231 +0x789
github.com/astaxie/beego.(*Namespace).Include(0xc4202150e0, 0xc4201cbc60, 0x1, 0x1, 0xc4202150e0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:186 +0x4d
github.com/astaxie/beego.NSInclude.func1(0xc4202150e0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:302 +0x46
github.com/astaxie/beego.NewNamespace(0xaae8aa, 0x9, 0xc42000d398, 0x1, 0x1, 0xc420221101)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
github.com/astaxie/beego.NSNamespace.func1(0xc4202150c0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:386 +0x52
github.com/astaxie/beego.NewNamespace(0xaae88f, 0x9, 0xc420169e98, 0x18, 0x18, 0xc420221170)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
aaa-api/routers.init.1()
    E:/m/go/src/aaa-api/routers/router.go:20 +0x17f4
panic: you are in dev mode. So please set gopath

goroutine 1 [running]:
github.com/astaxie/beego.(*ControllerRegister).Include(0xc4200c0790, 0xc4201dfc30, 0x1, 0x1)
    E:/m/go/src/github.com/astaxie/beego/router.go:231 +0x789
github.com/astaxie/beego.(*Namespace).Include(0xc4202270c0, 0xc4201dfc30, 0x1, 0x1, 0xc4202270c0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:186 +0x4d
github.com/astaxie/beego.NSInclude.func1(0xc4202270c0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:302 +0x46
github.com/astaxie/beego.NewNamespace(0xaae8aa, 0x9, 0xc42008d388, 0x1, 0x1, 0xc420233101)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
github.com/astaxie/beego.NSNamespace.func1(0xc4202270a0)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:386 +0x52
github.com/astaxie/beego.NewNamespace(0xaae88f, 0x9, 0xc420183e98, 0x18, 0x18, 0xc420233170)
    E:/m/go/src/github.com/astaxie/beego/namespace.go:42 +0x8c
aaa-api/routers.init.1()
    E:/m/go/src/aaa-api/routers/router.go:20 +0x17f4

我是用Supervisord部署的,之前一直正常。 然后把模式又dev转成prod就不报错了,为什么呢?都只能用prod了?

已邀请:

romny

赞同来自:

补充: 本地bee run运行都正常

voidint - https://github.com/voidint

赞同来自:

删除项目的pkg目录,使用1.10重新编译bee这个工具,try again。

jinheking

赞同来自:

go get -u github.com/beego/bee

romny

赞同来自:

悲剧继续,求大神们帮助:

KMBMac-mini% sudo go get -u github.com/beego/bee
go tool asm: exit status 2
flag provided but not defined: -V
usage: asm [options] file.s ...
Flags:
  -D value
        predefined symbol with optional simple value -D=identifier=value; can be set multiple times
  -I value
        include directory; can be set multiple times
  -S    print assembly and machine code
  -debug
        dump instructions as they are parsed
  -dynlink
        support references to Go symbols defined in other shared libraries
  -e    no limit on number of errors reported
  -o string
        output file; default foo.o for /a/b/c/foo.s as first argument
  -shared
        generate code that can be linked into a shared library
  -trimpath string
        remove prefix from recorded source file paths

这我是连安装不不行了? 我win10能升级,但是mac就这样报错. 我试过动过GOROOT中的pkg,和试过动过GOPATH中的pkg 然后都重装过go1.10和beego,就是不能装bee(这话说的:)) 我真没装b,就是删掉了src中的bee,再下载安装还是这样报错. 我要删掉最后的编译后的bee吗?

KMBMac-mini% bee version
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.9.0

├── Beego     : 1.9.2
├── GoVersion : go1.10
├── GOOS      : darwin
├── GOARCH    : amd64
├── NumCPU    : 4
├── GOPATH    : /Users/kmbmca/m/go
├── GOROOT    : /usr/local/go
├── Compiler  : gc
└── Date      : Wednesday, 28 Feb 2018

jinheking

赞同来自:

我没有在mac下做过,我只在win和Ubuntu下做过。没法帮到你了

ilovekitty328

赞同来自:

what is your macOS's version

romny

赞同来自:

macOS High Sierra 版本 10.13.3(17D102)

Mac mini(Late 2014)

ilovekitty328

赞同来自:

where did you get go 1.10 ?

ilovekitty328

赞同来自:

我这都没问题

romny

赞同来自:

最新情况: 还是一样,也没什么头绪 mac: 现在用bee 1.9还行,就是升不了

win10: bee能升上去

两台的bee run都正常 bee pack -be=GOOS=linux 出来放服务器都不能用dev模式

xiafish201

赞同来自:

我也遇到同样的问题了,为什么1.9版本就可以,升级到1.10就不行了

evassilyev

赞同来自:

Hello, guys! You should change the environment variable GOROOT to the actual path. It helped me. export GOROOT=/usr/lib/go-1.10

要回复问题请先登录注册