mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Use fmt.Errorf() (gosimple)
This fixes: pkg/cmd/grafana-cli/commands/install_command.go:36:11: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028) pkg/models/org_user.go:53:11: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028) pkg/services/notifications/mailer.go:138:16: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
This commit is contained in:
@@ -50,7 +50,7 @@ func (r *RoleType) UnmarshalJSON(data []byte) error {
|
||||
|
||||
if !(*r).IsValid() {
|
||||
if (*r) != "" {
|
||||
return errors.New(fmt.Sprintf("JSON validation error: invalid role value: %s", *r))
|
||||
return fmt.Errorf("JSON validation error: invalid role value: %s", *r)
|
||||
}
|
||||
|
||||
*r = ROLE_VIEWER
|
||||
|
||||
Reference in New Issue
Block a user