浏览代码

Merge pull request #13295 from aimxhaisse/13294-mflag-panic

Fix panic when using default-initialized FlagSet
Michael Crosby 10 年之前
父节点
当前提交
fc4f3e5650
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/mflag/flag.go

+ 1 - 1
pkg/mflag/flag.go

@@ -560,7 +560,7 @@ func defaultUsage(f *FlagSet) {
 // Usage prints to standard error a usage message documenting all defined command-line flags.
 // The function is a variable that may be changed to point to a custom function.
 var Usage = func() {
-	fmt.Fprintf(CommandLine.output, "Usage of %s:\n", os.Args[0])
+	fmt.Fprintf(CommandLine.Out(), "Usage of %s:\n", os.Args[0])
 	PrintDefaults()
 }