if username or password are specified, don't assume anonymous in example.go

This commit is contained in:
James Andariese 2015-04-12 22:18:06 -07:00
parent e8c25dcffe
commit a1c1069091

View File

@ -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()
}
}