-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
[Fix] 修复当调用 repository.go 中 GetXXXValue,类型不一致时的报错 #216
Conversation
感谢您提出Pull Request,我会尽快Review。我会在1-2日内进行查看或者回复,如果遇到节假日可能会处理较慢,敬请谅解。 |
storage/repository.go
Outdated
return defaultValue | ||
} | ||
return i | ||
return value.(int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if there is any error happened in type conversion, we need to log the error and return the default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right :)
I had fixed it.
@@ -195,89 +193,37 @@ func (c *internalClient) GetApolloConfigCache() agcache.CacheInterface { | |||
|
|||
//GetValue 获取配置 | |||
func (c *internalClient) GetValue(key string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is get default namespace for compatible old version, below as also.
@@ -49,11 +49,11 @@ func createMockApolloConfig(expireTime int) *internalClient { | |||
//string | |||
configs["string"] = "value" | |||
//int | |||
configs["int"] = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong case ,so change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
client.go
的GetXXXValue
方法到repository.go