Skip to content

Conversation

@alexandear
Copy link
Contributor

@alexandear alexandear commented Dec 14, 2025

This PR fixes these staticcheck lint issues:

Details

$ golangci-lint run
log/log.go:189:8: QF1004: could use strings.ReplaceAll instead (staticcheck)
        msg = strings.Replace(msg, "\n", "\\n", -1)
              ^
log/log.go:235:9: QF1004: could use strings.ReplaceAll instead (staticcheck)
                msg = strings.Replace(msg, "\n", "\\n", -1)
                      ^
mocks/sa.go:249:2: QF1003: could use tagged switch on req.Id (staticcheck)
        if req.Id == 2 {
        ^
policy/pa.go:391:16: QF1004: could use strings.Split instead (staticcheck)
        splitEmail := strings.SplitN(email.Address, "@", -1)
                      ^
publisher/publisher_test.go:70:3: QF1007: could merge conditional assignment into variable declaration (staticcheck)
                precert := false
                ^
publisher/publisher_test.go:95:3: QF1007: could merge conditional assignment into variable declaration (staticcheck)
                precert := false
                ^
ra/ra_test.go:670:18: QF1009: probably want to use time.Time.Equal instead (staticcheck)
                test.Assert(t, *challenge.Validated == expectedValidated, "Validated timestamp incorrect or missing")
                               ^
ra/ra_test.go:882:17: QF1009: probably want to use time.Time.Equal instead (staticcheck)
        test.Assert(t, *challenge.Validated == expectedValidated, "Validated timestamp incorrect or missing")
                       ^
test/certs/webpki.go:110:16: QF1004: could use strings.ReplaceAll instead (staticcheck)
                        fileName := strings.Replace(name, " ", "-", -1)
                                    ^
test/s3-test-srv/main.go:25:2: QF1003: could use tagged switch on r.Method (staticcheck)
        if r.Method == "PUT" {
        ^
10 issues:
* staticcheck: 10

This partially addresses the TODO comment:

boulder/.golangci.yml

Lines 67 to 70 in be957c2

staticcheck:
checks:
- all
# TODO: Identify, fix, and remove violations of most of these rules

@alexandear alexandear requested a review from a team as a code owner December 14, 2025 17:17
aarongable
aarongable previously approved these changes Dec 15, 2025
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one optional nit.

@beautifulentropy beautifulentropy merged commit a769ed6 into letsencrypt:main Dec 16, 2025
17 checks passed
@alexandear alexandear deleted the lint/fix-qf-staticcheck branch December 16, 2025 18:23
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