flag 에러 메시지 무시

This commit is contained in:
2023-06-20 17:32:43 +09:00
parent 77c9c953a4
commit 0e94c204d3

View File

@ -2,6 +2,7 @@ package gocommon
import ( import (
"flag" "flag"
"io"
"os" "os"
) )
@ -16,5 +17,6 @@ var NeedPrefetch = commandLine.Bool("prefetch", false, "")
var Linkupdate = commandLine.String("updatelink", "", "") var Linkupdate = commandLine.String("updatelink", "", "")
func init() { func init() {
commandLine.SetOutput(io.Discard)
commandLine.Parse(os.Args[1:]) commandLine.Parse(os.Args[1:])
} }