Files
member-console/internal/integrations
cgalo5758 c8263bfe0e Turn on nilerr: a function that returns an error may not swallow one
docs/go-conventions.md says a failed read is never an answer, and
nothing checked it. nilerr refuses one form of that: a function that
returns an error catches one and returns nil. On the tree it found 15
such returns. 12 were the project lint's walkers, which the parent
commit replaced. The other three:

- CheckQuotaActivity answers a failed read of the sites entitlement as
  a quota of 0, which tells the member they have reached their site
  limit. That is #231; the return is pinned in .golangci.yml by its
  source line until #231 removes it.
- paymentMethodID in the invoice reconcile returned no id when the
  mapped payment method id did not parse. The column is UUID NOT NULL,
  so that cannot happen with the data the schema allows; the function
  now returns the error, so a row that breaks the rule is reported
  instead of read as unlinked. Not probed: no test can store a value
  the column refuses.
- The domain claim's connect probe answers a failed lookup of the
  operator's own target as ProbeStateError, the state that says the
  record could not be checked. That is the probe's answer, so the
  return is exempt with that reason.

With the pins, golangci-lint reports none. 2 breaks, each caught by
scripts/golangci-lint.sh: a read error returned as nil in the lint's
readTree, and the payment method id's parse error returned as nil.
The rule's page names nilerr as its check and says what it leaves to
review: a failed read turned into an empty list or a zero by a function
that returns a value. docs/testing.md lists nilerr among the linters.
make lint passes; the Stripe workflows and lint packages pass with the
database tests skipped (the test stack was down).
2026-10-15 22:11:26 -05:00
..