-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Description
Just a suggestion, I can also see it as intentional, since it would allow too complicated blocks maybe. I stumble a lot into that in my code, so I have some examples and can tackle down if and how we can improve this. I'm also very critic to myself that this suggestion is wrong and I have to overthink my code :)
what this rule wants:
r := map[string]string{}
for k, v := range m {
r[k] = v
}
I often have a range
with a little if if !thisorthat()
r := map[string]string{}
for k, v := range m {
if !c.IsReserved(k) {
r[k] = v
}
}
Or a switch-case:
c.Environment = make(map[string]string)
for _, env := range req.GetConfig().GetEnvs() {
switch env.GetKey() {
case "user-data":
c.CloudInitUserData = env.GetValue()
default:
c.Environment[env.GetKey()] = env.GetValue()
}
}
Metadata
Metadata
Assignees
Labels
No labels