-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nil与interface无法进行比较 #44
Comments
不是很理解这个问题,当变量声明为指针但没有赋值,是可以用nil判空的。 |
但其为一个接口,接口赋值为nil,只是其value被赋值为nil,结构体其他成员不为nil,所以接口不等于nil,两者比较是不等的 |
明白了,是指config被其它方法赋值[nil, nil]时造成的问题。确实会有这个情况。不过config模块是要初始化才能用,这个值也永远不会空。 晚点修复。点赞! |
@younglifestyle 要不你来修? |
这里估计不用改,按照代码的逻辑感觉确实是不会出现问题,打扰了打扰了 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/stack-labs/stack-rpc/blob/8087580622499aa3f49420d4e4831ed11bc76e4c/pkg/config/config.go#L231
这是micro之前代码的问题,nil与interface直接进行比较,两者是比较不了的
The text was updated successfully, but these errors were encountered: