Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

【重要】part 1 根据代码库操作报错 #260

Open
lipeigang opened this issue Jul 15, 2020 · 2 comments
Open

【重要】part 1 根据代码库操作报错 #260

lipeigang opened this issue Jul 15, 2020 · 2 comments

Comments

@lipeigang
Copy link

调用
micro --registry=etcd call mu.micro.book.service.user User.QueryUserByName '{"userName":"micro"}'
返回
error calling mu.micro.book.service.user.User.QueryUserByName: {"id":"go.micro.server","code":500,"detail":"panic recovered: runtime error: invalid memory address or nil pointer dereference","status":"Internal Server Error"}

检查发现
在 basic/db/mysql.go 中,需要把初始化的 mysqlDB 返回。
并在调用方 basic/db/db.go 第 32 行,改为 mysqlDB = initMysql()

@printfcoder
Copy link
Owner

试试: go run main.go plugin.go

@lipeigang
Copy link
Author

试试: go run main.go plugin.go

试过,不起作用

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants