mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Use strings.ReplaceAll and preallocate containers (#58483)
This commit is contained in:
@@ -165,7 +165,7 @@ func (r RoleDTO) MarshalJSON() ([]byte, error) {
|
||||
func fallbackDisplayName(rName string) string {
|
||||
// removing prefix for fixed roles
|
||||
rNameWithoutPrefix := strings.Replace(rName, FixedRolePrefix, "", 1)
|
||||
return strings.TrimSpace(strings.Replace(rNameWithoutPrefix, ":", " ", -1))
|
||||
return strings.TrimSpace(strings.ReplaceAll(rNameWithoutPrefix, ":", " "))
|
||||
}
|
||||
|
||||
type TeamRole struct {
|
||||
|
||||
Reference in New Issue
Block a user