Skip to content

Comments

Remove various unnecessary uses of fmt.Sprintf#3707

Merged
rolandshoemaker merged 1 commit intoletsencrypt:masterfrom
4a6f656c:sprintf-cleanup
May 11, 2018
Merged

Remove various unnecessary uses of fmt.Sprintf#3707
rolandshoemaker merged 1 commit intoletsencrypt:masterfrom
4a6f656c:sprintf-cleanup

Conversation

@4a6f656c
Copy link
Contributor

Remove various unnecessary uses of fmt.Sprintf.

  • Avoid calls like t.Error(fmt.Sprintf(...)), where t.Errorf can be used directly.

  • Use strconv when converting an integer to a string, rather than using
    fmt.Sprintf("%d", ...). This is simpler and can also detect type errors at
    compile time.

  • Instead of using x.Write([]byte(fmt.Sprintf(...))), use fmt.Fprintf(x, ...).

Remove various unnecessary uses of fmt.Sprintf - in particular:

- Avoid calls like t.Error(fmt.Sprintf(...)), where t.Errorf can be used directly.

- Use strconv when converting an integer to a string, rather than using
  fmt.Sprintf("%d", ...). This is simpler and can also detect type errors at
  compile time.

- Instead of using x.Write([]byte(fmt.Sprintf(...))), use fmt.Fprintf(x, ...).
@4a6f656c 4a6f656c requested a review from a team as a code owner May 11, 2018 14:49
@4a6f656c 4a6f656c changed the title CAA recheck test Remove various unnecessary uses of fmt.Sprintf May 11, 2018
@rolandshoemaker rolandshoemaker merged commit f8a023e into letsencrypt:master May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants