Skip to content

refactor!: upgrade to golangci-lint v2 and fix lint findings (DOCS-936) - #300

Merged
Justin Hammond (Justintime50) merged 6 commits into
masterfrom
golangci_lint_v2
Nov 17, 2026
Merged

Justin Hammond (Justintime50) merged 6 commits into
masterfrom
golangci_lint_v2

Conversation

@Justintime50

@Justintime50 Justin Hammond (Justintime50) commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Description

Upgrades golangci-lint from v1.64.6 to v2.15.0 for DOCS-936, since v1 doesn't support Go 1.26+. Part of the v6 major.

  • Bumps the examples submodule from 739f96c to chore: migrate Go lint config to golangci-lint v2 (DOCS-936) examples#258 (75 examples commits), which migrates the shared style_guides/golang/.golangci.yml to v2. The bump also picks up the earlier fixture move to examples/fixtures/ (flatten structure examples#250), so test paths are updated.
  • Installs via https://golangci-lint.run/install.sh; the old master install.sh fails checksum verification on recent releases.
  • CI lint job now runs on Go 1.27.
  • Bumps gosec from v2.22.11 to v2.30.0; the old version crashes on Go 1.27.
  • Fixes the new findings. Most are staticcheck ST1003 initialism renames, which are breaking for 29 exported identifiers (e.g. Id to ID, Url to URL, ExternalApiError to ExternalAPIError, and BetaCreateBankAccountClientSecretWithReturlUrl to BetaCreateBankAccountClientSecretWithReturnURL, fixing the typo). JSON and URL tags are unchanged. The full list is in UPGRADE_GUIDE.md and CHANGELOG.md.

Testing

Existing cassettes replay unchanged on Go 1.16, 1.24 and 1.27.

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement (fixing a typo, updating readme, renaming a variable name, etc.)

@Justintime50 Justin Hammond (Justintime50) changed the title DOCS-936: refactor!: upgrade to golangci-lint v2 and fix lint findings refactor!: upgrade to golangci-lint v2 and fix lint findings (DOCS-936) Nov 16, 2026
@Justintime50
Justin Hammond (Justintime50) marked this pull request as ready for review November 16, 2026 18:00

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good. merge examples#258 first and re-pin the submodule to its squash commit? d1778d1 is the branch head, and examples squash-merges and deletes the branch

also, while we're in a major: BetaRefundByAmount and BetaRefundByPaymentLog (referral_customer.go:223,239) pass a nil out to c.do, so a 2xx errors with json: Unmarshal(nil *easypost.BetaPaymentRefund) (the tests only replay 422s). &out fixes it. same file, :165 sends "mandata_data" where the other libs send mandate_data

Bumps golangci-lint to v2.15.0 (v1 doesn't support newer Go), points the
examples submodule at the v2 shared config, and lints CI on Go 1.27.
Fixes the new findings, mostly ST1003 initialism renames.

BREAKING CHANGE: exported identifiers are renamed to use Go initialisms
(e.g. Id to ID, Url to URL). JSON and URL tags are unchanged. See
UPGRADE_GUIDE.md for the full list.
BetaRefundByAmount and BetaRefundByPaymentLog passed a nil out to c.do,
so a successful response failed to decode. AddReferralCustomerBankAccountFromStripe
sent mandata_data instead of mandate_data.
BetaAddPaymentMethodWithContext passed a nil out to c.do, so a successful
response failed to decode. Pass &out, matching the beta refund fix.
@Justintime50
Justin Hammond (Justintime50) merged commit 528c035 into master Nov 17, 2026
17 checks passed
@Justintime50
Justin Hammond (Justintime50) deleted the golangci_lint_v2 branch November 17, 2026 18:00
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.

2 participants