Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress
logging before flag.Parse
from glog (#2970)
Replace `goflag.Parse()` call with `goflag.CommandLine.Parse([]string{})` This serves multiple purposes 1. We don't actually parse the os.Args (which Parse() method internally does). This ensures that the command line arguments are parsed only by RootCmd.Execute() call (which is the parent command) 2. We suppress the `Error: Logging before flag.Parse...` warning messages. https://github.com/golang/glog/blob/master/glog.go#L679 causes the warning message and we suppress this warning by calling the Parse method on the underlying flagset. Signed-off-by: Ibrahim Jarif <[email protected]>
- Loading branch information