From f17cf17e4f498a837b18cecc0f521d8aa47fd9f9 Mon Sep 17 00:00:00 2001 From: kzkzzzz Date: Sun, 23 Jun 2024 13:26:48 +0800 Subject: [PATCH] update --- myconf/conf.go | 3 +++ 1 file changed, 3 insertions(+) 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))