diff --git a/myconf/conf.go b/myconf/conf.go index 0e31646..33ddc5c 100644 --- a/myconf/conf.go +++ b/myconf/conf.go @@ -11,6 +11,9 @@ var ( ) func LoadFlag() { + if !pflag.Parsed() { + pflag.Parse() + } err := vp.BindPFlags(pflag.CommandLine) if err != nil { panic(fmt.Errorf("load command line fail: %s", err))