Skip to content

fix(go): resolve pre-existing lint, staticcheck, and RAT debt - #7

Open
will-sargent-dbtlabs wants to merge 1 commit into
mainfrom
fix/lint-staticcheck-rat-debt
Open

fix(go): resolve pre-existing lint, staticcheck, and RAT debt#7
will-sargent-dbtlabs wants to merge 1 commit into
mainfrom
fix/lint-staticcheck-rat-debt

Conversation

@will-sargent-dbtlabs

Copy link
Copy Markdown

Summary

Baseline repo-health cleanup for main, split out from an unrelated PR (#6) since this is a separate failure domain from the GCP auth/CI issue also being tracked (see follow-up).

  • errcheck (9): explicitly discard errors on deferred Close() calls (file handle, Dataproc/notebook gRPC clients, HTTP response body, GCS reader/client) — matches the existing pattern used elsewhere in this package for calls where propagating the close error would require restructuring the function.
  • staticcheck SA4006: executeCreateNotebookExecutionJob discarded op.Wait's return value before the polling loop immediately overwrote it — made that explicit.
  • staticcheck SA1029: ContextKeyUseStorageApiDisabledClient now has its own contextKey type instead of colliding with plain string context keys.
  • staticcheck ST1023 / QF1011 + intrange: dropped the redundant oauth2.TokenSource type annotation and modernized the row iterator's counting loop to range-over-int — both are go fix's own suggestions.
  • rat: added the missing ADBC Drivers Contributors license header to PORT_REVIEW.md (it wasn't in .rat-excludes and every other doc file in the repo carries this header).

No behavior changes — purely lint/staticcheck/license compliance.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...
  • golangci-lint run — 0 issues (was 15)
  • pre-commit run --all-files on changed files — all hooks pass, including rat

- errcheck: explicitly discard errors on 9 deferred Close() calls
  (file, gRPC clients, response bodies, GCS readers).
- staticcheck SA4006: stop discarding the op.Wait result in
  executeCreateNotebookExecutionJob before it's immediately
  overwritten by the polling loop.
- staticcheck SA1029: give ContextKeyUseStorageApiDisabledClient its
  own contextKey type instead of using a bare string as a context key.
- staticcheck ST1023/QF1011 + intrange: drop the redundant
  oauth2.TokenSource type annotation and modernize the row iterator's
  counting loop to range-over-int (go fix's suggestions).
- rat: add the missing ADBC Drivers Contributors license header to
  PORT_REVIEW.md.

Verified locally: golangci-lint, go build/vet/test, codespell, go fix,
and the Apache RAT check all pass clean.
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.

1 participant