Skip to content

Conversation

@shwoodard
Copy link
Collaborator

Given that err is very commonly assigned as an error, it is better to use a different variable name, e.g. wantErr.

@shwoodard shwoodard requested a review from a team as a code owner August 22, 2025 16:44
@shwoodard shwoodard requested a review from noahdietz August 22, 2025 16:44
@shwoodard shwoodard force-pushed the aip-141-count-suffix-test-fix branch from ac59006 to 7aaf683 Compare August 22, 2025 17:06
Copy link
Contributor

@quirogas quirogas left a comment

Choose a reason for hiding this comment

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

I like the change and the reasoning behind it. tiny comment though, this pattern is already present in most of our tests, so I think it would be better if we adopted it everywhere.

@noahdietz
Copy link
Collaborator

I like the change and the reasoning behind it. tiny comment though, this pattern is already present in most of our tests, so I think it would be better if we adopted it everywhere.

Yeah we were discussing this in #1523 (comment) and we may want to see about refactoring to one pattern or the other. @shwoodard if you want to change all other instances of test.err to test.wantErr in this PR, that would be great, but also don't feel like you have to, @quirogas and I can do it in a separate change.

That said, @quirogas we may want to reduce noise in main branch while you are working on v2 to avoid gnarly merges for you :)

@shwoodard
Copy link
Collaborator Author

I like the change and the reasoning behind it. tiny comment though, this pattern is already present in most of our tests, so I think it would be better if we adopted it everywhere.

I could only find the one instance of this,

$ find ./rules -name "*_test.go" | xargs grep -E "err[^b]+bool"
./rules/aip0141/count_suffix_test.go:		err       bool

Given that `err` is very commonly assigned as an `error`, it is better
to use a different variable name, e.g. `wantErr`.
@shwoodard shwoodard force-pushed the aip-141-count-suffix-test-fix branch from 7aaf683 to 91b183c Compare August 22, 2025 18:27
@shwoodard shwoodard merged commit 4971f76 into googleapis:main Aug 22, 2025
5 checks passed
@shwoodard shwoodard deleted the aip-141-count-suffix-test-fix branch August 22, 2025 19:30
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