Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race on in generation of completions and docs
After adding the calls to `cmd.RegisterFlagCompletionFunc()`, `go generate` usually failed because of "concurrent map writes". We used some goroutines that each create their own `cobra.Command`. Apparently these shared some data, hence the race. As a workaround, make the generation code single-threaded. Maybe the commands should be created only once in `init()`? I'm not sure.
- Loading branch information
Showing
2 changed files
with
14 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters