From a1c1069091ad699a9632f52f2f9b0d46075404c4 Mon Sep 17 00:00:00 2001 From: James Andariese Date: Sun, 12 Apr 2015 22:18:06 -0700 Subject: [PATCH] if username or password are specified, don't assume anonymous in example.go --- _example/example.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_example/example.go b/_example/example.go index 9d8d707..136af5a 100644 --- a/_example/example.go +++ b/_example/example.go @@ -32,8 +32,10 @@ func main() { } flag.Parse() if *username == "" || *password == "" { - if *debug { + if *debug && *username == "" && *password == "" { fmt.Fprintf(os.Stderr, "no username or password were given; attempting ANONYMOUS auth\n") + } else if *username != "" || *password != "" { + flag.Usage() } }