The Go Programming Rule #200
AlexStocks
announced in
Announcements
Replies: 3 comments 1 reply
-
for table, rule := range router.mrMap {
o.ShardingRuleMap[strings.ToLower(table)] = &rule
} 截图用了 for-loop 的变量,结果导致 o.ShardingRuleMap[strings.ToLower(table)] 改进后代码如下: for table := range router.mrMap {
rule := router.mrMap[table]
o.ShardingRuleMap[strings.ToLower(table)] = &rule
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
这个感觉可以通过linter 做检查? |
Beta Was this translation helpful? Give feedback.
0 replies
-
不要调用 struct.String() 函数。在记录日志过程中,不管日志是否输出,这个函数都会被调用。apache/dubbo-go#1955 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Go 编程规范
Beta Was this translation helpful? Give feedback.
All reactions