You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
staticcheck: flag strings.ToUpper(name[:1])+name[1:] #517
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…
Activity
[-]strings.ToUpper(name[:1])+name[1:][/-][+]staticcheck: flag strings.ToUpper(name[:1])+name[1:][/+]