ci: ensure "go fmt" formatting, use "any" instead of "interface{}"#150
Conversation
Command used:
gofmt -w -r 'interface{} -> any' .
|
Thanks @benhoyt ! |
benhoyt
left a comment
There was a problem hiding this comment.
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\{\}' |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
| - name: Ensure no use of empty interface (should be any) | ||
| run: | | ||
| ! egrep -R --exclude-dir .git 'interface\{\}' |
There was a problem hiding this comment.
How about matching the string verbatim?
| ! egrep -R --exclude-dir .git 'interface\{\}' | |
| ! grep -R --exclude-dir=.git -F 'interface{}' . |
Adds a check in CI that
go fmt ./...doesn't change anything, and thatanyis used instead ofinterface{}.(Lifted entirely from Pebble).
To satisfy the new check, also contains a
go fmt ./...run, which cleans up some whitespace in client_test.go.