Fix more golint warnings.
[arvados.git] / lib / config / cmd.go
index dd6f1f98c577527c1cfb84ffdb2b05ef314d635b..347e8519a9717dff33eaefee1a3ed2570a4d013c 100644 (file)
@@ -91,6 +91,7 @@ func (checkCommand) RunCommand(prog string, args []string, stdin io.Reader, stdo
        flags := flag.NewFlagSet("", flag.ContinueOnError)
        flags.SetOutput(stderr)
        loader.SetupFlags(flags)
+       strict := flags.Bool("strict", true, "Strict validation of configuration file (warnings result in non-zero exit code)")
 
        err = flags.Parse(args)
        if err == flag.ErrHelp {
@@ -148,19 +149,19 @@ func (checkCommand) RunCommand(prog string, args []string, stdin io.Reader, stdo
                fmt.Fprintln(stdout, "Your configuration is relying on deprecated entries. Suggest making the following changes.")
                stdout.Write(diff)
                err = nil
-               if loader.Strict {
+               if *strict {
                        return 1
                }
        } else if len(diff) > 0 {
                fmt.Fprintf(stderr, "Unexpected diff output:\n%s", diff)
-               if loader.Strict {
+               if *strict {
                        return 1
                }
        } else if err != nil {
                return 1
        }
        if logbuf.Len() > 0 {
-               if loader.Strict {
+               if *strict {
                        return 1
                }
        }