chore: replace interface{} with any and enforce it via lint - #1206
Merged
Merged
Conversation
Pure alias rename; any has been the idiomatic spelling since Go 1.18. The struct tag realignment is gofmt output from the shorter name.
Also sets a 5m run timeout so a hung lint run fails in CI instead of blocking the job.
Contributor
|
Claude finished @dangrondahl's task in 1m 28s —— View job Follow-up review complete
Prior findings — both resolved and threads closed:
Verified no New issues in the touched lines: none. The two new commits only touch |
The timeout was passed as a flag in both the Makefile and the CI workflow, which overrides the config file value.
golangci-lint now rejects interface{} via a gofmt rewrite rule, but
go fmt does not apply rewrite rules, so make fmt could not fix what
make lint rejected. Use gofmt directly rather than golangci-lint fmt
because make build runs in the Dockerfile without golangci-lint.
Also drops the --timeout flag from make lint (see previous commit).
dangrondahl
enabled auto-merge (squash)
September 18, 2026 05:29
ToreMerkely
approved these changes
Sep 18, 2026
mbevc1
reviewed
Sep 18, 2026
| uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| version: latest | ||
| args: --timeout=5m -v |
Contributor
There was a problem hiding this comment.
Is it intentional as it's not a part of the PR description?
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
kosli-cli 2.43.1 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>- Attestation commands now warn (instead of failing) when a CI-defaulted `--commit` cannot be resolved from the repository, allowing jobs without a checked-out repo to proceed without commit info. - Commands that require commit info (`attest pullrequest`, `attest jira`) now emit a clear error when the commit cannot be resolved, rather than silently proceeding or panicking. - Explicit `--commit` or `--repo-root` flags that cannot be resolved now produce a descriptive error pointing to the correct fix. <!-- Release notes generated using configuration in .github/release.yml at v2.43.1 --> ## What's Changed * fix(k8s): name artifacts by image reference when the runtime reports an image ID by @dangrondahl in kosli-dev/cli#1204 * chore: replace interface{} with any and enforce it via lint by @dangrondahl in kosli-dev/cli#1206 * fix(attest): don't fail when a CI-defaulted --commit has no repository by @mbevc1 in kosli-dev/cli#1202 * fix(table output): sort tags so table output is deterministic by @dangrondahl in kosli-dev/cli#1207 **Full Changelog**: kosli-dev/cli@v2.43.0...v2.43.1 </pre> <p>View the full release notes at <a href="https://github.com/kosli-dev/cli/releases/tag/v2.43.1">https://github.com/kosli-dev/cli/releases/tag/v2.43.1</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!20579
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces every
interface{}in the codebase withany, and adds a gofmt rewrite rule to.golangci.ymlsomake lintfails ifinterface{}is reintroduced.The main reason is readability. This codebase decodes many API responses into
map[string]anyand[]map[string]any, and those nested types are much easier to scan with the shorter name.anyhas also been the idiomatic spelling since Go 1.18, and it is what the standard library andgo fixuse.anyis a pure alias forinterface{}, so there is no behaviour change. The large first commit is 558 lines in / 558 lines out: the alias rename plus the struct tag realignment gofmt produces from the shorter name. Reviewing it commit by commit is recommended.The rename commit also carries one unrelated fix: a comment typo (
environemnt) incmd/kosli/getSnapshot_test.go. That file has nointerface{}in it, which is why it otherwise looks out of place.Follow-up commits from review:
make fmtnow applies the same rewrite rule, so it can fix whatmake lintrejects. It usesgofmt -rdirectly rather thangolangci-lint fmtbecausemake buildruns in the Dockerfile without golangci-lint..golangci.yml. The--timeoutflag was removed from the Makefile and the CI workflow, where it was overriding the config value.No CLI help text, Helm chart, or Terraform changes are involved.
Checklist
charts/k8s-reporter/) updated, if needed. Note: these changes live in a separate PR (not needed)