-
-
Notifications
You must be signed in to change notification settings - Fork 408
staticcheck: flag strings.ToUpper(name[:1])+name[1:] #517
Copy link
Copy link
Open
Labels
aggressiveA set of checks that is more prone to false positives but is helpful during code reviewA set of checks that is more prone to false positives but is helpful during code reviewneeds-decisionWe have to decide if this check is feasible and desirableWe have to decide if this check is feasible and desirablenew-check
Milestone
Metadata
Metadata
Assignees
Labels
aggressiveA set of checks that is more prone to false positives but is helpful during code reviewA set of checks that is more prone to false positives but is helpful during code reviewneeds-decisionWe have to decide if this check is feasible and desirableWe have to decide if this check is feasible and desirablenew-check
String slicing works based on bytes, not runes. When dealing with unicode input,
strings.ToUpper(name[:1])+name[1:]is a broken implementation of capitalizing the first letter in a string.However, when dealing with strictly ASCII, the code is correct, so flagging the construct could cause false positives…