Please answer these questions before submitting your issue. Thanks!
What version of Go and beego are you using (bee version)?
go 1.9.2
beego 1.9.1
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/yansen/go"
GORACE=""
GOROOT="/usr/local/go1.9"
GOTOOLDIR="/usr/local/go1.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build151996307=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
这个情况在我开发环境是正常的,开发环境的版本跟生产环境不一样。
我有一个 UserController , 里面自定义了一个属性 dao , 用来调用对应的 models 及方法。
dao 是小写,也就是私有的。
然后报错出现在 router.go 的 206行
What did you expect to see?
正常编译运行
What did you see instead?
```bash
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] the request url is /api/user
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] Handler crashed with error reflect: reflect.Value.Set using value obtained using unexported field
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/runtime/asm_amd64.s:509
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/runtime/panic.go:491
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/reflect/value.go:225
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/reflect/value.go:1351
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /home/yansen/go/src/github.com/astaxie/beego/router.go:208
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /home/yansen/go/src/github.com/astaxie/beego/router.go:797
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/net/http/server.go:2619
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/net/http/server.go:1801
2017/12/09 11:46:10.840 [C] [asm_amd64.s:509] /usr/local/go1.9/src/runtime/asm_amd64.s:2337
````
我开发环境是beego 是 1.9.0 的版本。生产环境降到这个版本就没有问题了。
应该是 1.9.1 的bug了
I have the same issue after upgraded to beego 1.9.2 today
thx
Is this issue fixed?
这个问题怎么解决呀。。。
Hello,
Unfortunately, I was encapsulating a BaseController, so when the beego engine initialize the router, ends with this panic.
Maybe in your case an unexported field at controller level is causing the panic.
Hope I have helped.
It may be the Controller contains param begin with lower case letters. Make it upper case.
still exist in 1.9.3
Most helpful comment
Hello,
Unfortunately, I was encapsulating a BaseController, so when the beego engine initialize the router, ends with this panic.
Maybe in your case an unexported field at controller level is causing the panic.
Hope I have helped.