Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flag initialization #2755

Merged
merged 2 commits into from
Jun 7, 2022
Merged

Fix flag initialization #2755

merged 2 commits into from
Jun 7, 2022

Conversation

pav-kv
Copy link
Contributor

@pav-kv pav-kv commented Jun 7, 2022

Flag parsing happens in main, after all init functions have been called.
This change moves the parsing code, incorrectly placed in init, to a
custom flag Set method.

#1188

Checklist

@pav-kv pav-kv requested review from AlCutter and phbnf June 7, 2022 16:59
@pav-kv pav-kv unassigned phbnf and AlCutter Jun 7, 2022
@pav-kv pav-kv marked this pull request as ready for review June 7, 2022 16:59
@pav-kv pav-kv requested a review from a team as a code owner June 7, 2022 17:00
log/sequencer.go Show resolved Hide resolved
@AlCutter
Copy link
Member

AlCutter commented Jun 7, 2022

Seems like there might be a bad interaction with flagsaver in the tests?

Copy link
Contributor

@pphaneuf pphaneuf left a comment

Choose a reason for hiding this comment

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

Oh, yeah, using flags before flag.Parse() is called is Very Forbidden!

Flag parsing happens in main, after all init functions have been called.
This change moves the parsing code, incorrectly placed in init, to a
custom flag Set method.
@pav-kv
Copy link
Contributor Author

pav-kv commented Jun 7, 2022

Seems like there might be a bad interaction with flagsaver in the tests?

Fixed (hopefully).

@pav-kv pav-kv merged commit 739a853 into google:master Jun 7, 2022
@pav-kv pav-kv deleted the fix_flag_init branch June 7, 2022 17:57
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.

4 participants