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.
Fixes #1141
I think this PR is a nice, clean solution to the problem. Unfortunately, as you can see, it also has the side-effect of removing the red coloured text from the error message since the executor/logger are out of scope in
main
🙁 I'm not sure what the best solution is for this. We weren't always consistent with showing errors in coloured text anyway.e.Setup()
and errors can occur before that which would result in nil pointer panics.--color
flag andNO_COLOR
envvar.@andreynering wdyt?
Also, since we needed access to the flags in the main function, I've moved them to a package-level struct variable. It means we can access them outside the
run()
function and also has the nice side-effect of namespacing the variables. i.e.versionFlag
->flag.version