Skip to content

Commit b05a2b2

Browse files
authored
Merge pull request #3486 from tao12345666333/rm-unnecessary-str-fmt
remotes: remove unnecessary string formatting
2 parents ca2463a + 4b4ce4a commit b05a2b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

remotes/docker/authorizer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (ah *authHandler) doBasicAuth(ctx context.Context) (string, error) {
265265
}
266266

267267
auth := base64.StdEncoding.EncodeToString([]byte(username + ":" + secret))
268-
return fmt.Sprintf("%s %s", "Basic", auth), nil
268+
return fmt.Sprintf("Basic %s", auth), nil
269269
}
270270

271271
func (ah *authHandler) doBearerAuth(ctx context.Context) (string, error) {
@@ -307,7 +307,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (string, error) {
307307
token, err = ah.fetchToken(ctx, to)
308308
err = errors.Wrap(err, "failed to fetch anonymous token")
309309
}
310-
token = fmt.Sprintf("%s %s", "Bearer", token)
310+
token = fmt.Sprintf("Bearer %s", token)
311311

312312
r.token, r.err = token, err
313313
r.Done()

0 commit comments

Comments
 (0)