Skip to content

Commit 6aef43c

Browse files
committed
chore: fix 'non-constant format string' errors
1 parent 3f6448d commit 6aef43c

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

influx/databases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (c *Client) UpdateRP(ctx context.Context, db string, rp string, upd *chrono
126126
// At last, we can check if there are any error strings
127127
for _, r := range results {
128128
if r.Error != "" {
129-
return nil, fmt.Errorf(r.Error)
129+
return nil, fmt.Errorf("%s", r.Error)
130130
}
131131
}
132132

influx/influx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func (c *Client) ping(u *url.URL) (string, string, error) {
327327
}
328328

329329
if resp.StatusCode != http.StatusNoContent {
330-
var err = fmt.Errorf(string(body))
330+
var err = fmt.Errorf("%s", string(body))
331331
return "", "", err
332332
}
333333

influx/users.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (c *Client) Delete(ctx context.Context, u *chronograf.User) error {
4848
// At last, we can check if there are any error strings
4949
for _, r := range results {
5050
if r.Error != "" {
51-
return fmt.Errorf(r.Error)
51+
return fmt.Errorf("%s", r.Error)
5252
}
5353
}
5454
return nil
@@ -227,7 +227,7 @@ func (c *Client) updatePassword(ctx context.Context, name, passwd string) error
227227
// At last, we can check if there are any error strings
228228
for _, r := range results {
229229
if r.Error != "" {
230-
return fmt.Errorf(r.Error)
230+
return fmt.Errorf("%s", r.Error)
231231
}
232232
}
233233
return nil

oauth2/generic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (g *Generic) PrincipalID(provider *http.Client) (string, error) {
115115
if ok := ofDomain(g.Domains, email); !ok {
116116
msg := "Not a member of required domain"
117117
g.Logger.Error(msg)
118-
return "", fmt.Errorf(msg)
118+
return "", fmt.Errorf("%s", msg)
119119
}
120120
}
121121

0 commit comments

Comments
 (0)