Skip to content

ci: ensure "go fmt" formatting, use "any" instead of "interface{}"#150

Merged
tonyandrewmeyer merged 4 commits intocanonical:mainfrom
tonyandrewmeyer:add-format-check-to-ci
Feb 3, 2026
Merged

ci: ensure "go fmt" formatting, use "any" instead of "interface{}"#150
tonyandrewmeyer merged 4 commits intocanonical:mainfrom
tonyandrewmeyer:add-format-check-to-ci

Conversation

@tonyandrewmeyer
Copy link
Contributor

@tonyandrewmeyer tonyandrewmeyer commented Feb 2, 2026

Adds a check in CI that go fmt ./... doesn't change anything, and that any is used instead of interface{}.

(Lifted entirely from Pebble).

To satisfy the new check, also contains a go fmt ./... run, which cleans up some whitespace in client_test.go.

@tonyandrewmeyer
Copy link
Contributor Author

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Thanks for this. Let's just get CI running/passing.

- name: Ensure no use of empty interface (should be any)
run: |
! egrep -R --exclude-dir .git 'interface\{\}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing this isn't working/running yet, as there were a bunch of instances of interface{}. I've pushed a commit which updates those using gofmt -r (rewrite rule).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what the story is with CI, I'm seeing them just queued and the action summary has:

The job was not acquired by Runner of type hosted even after multiple attempts

I'm hoping this is just some slowness on GitHub at the moment and it'll resolve itself. I'm seeing it in #147 at the moment as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benhoyt benhoyt changed the title ci: check that the code is formatted correctly, and there are no empty interfaces ci: check that the code is formatted correctly, and use any instead of interface{} Feb 2, 2026
@benhoyt benhoyt changed the title ci: check that the code is formatted correctly, and use any instead of interface{} ci: ensure "go fmt" formatting, use "any" instead of "interface{}" Feb 2, 2026
- name: Ensure no use of empty interface (should be any)
run: |
! egrep -R --exclude-dir .git 'interface\{\}'
Copy link
Contributor

Choose a reason for hiding this comment

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

How about matching the string verbatim?

Suggested change
! egrep -R --exclude-dir .git 'interface\{\}'
! grep -R --exclude-dir=.git -F 'interface{}' .

@tonyandrewmeyer tonyandrewmeyer merged commit 2faeb5b into canonical:main Feb 3, 2026
28 of 31 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the add-format-check-to-ci branch February 3, 2026 00:52
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