net/url: avoid if statement

Change-Id: I894a8f49d29dbb6f9265e4b3df5767318b225460
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Reviewed-on: https://go-review.googlesource.com/24492
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Antonio Murdaca 2016-06-26 12:14:41 +02:00 committed by Brad Fitzpatrick
parent 5df7f5220f
commit 4383e4387b

View file

@ -356,10 +356,7 @@ func (u *Userinfo) Username() string {
// Password returns the password in case it is set, and whether it is set.
func (u *Userinfo) Password() (string, bool) {
if u.passwordSet {
return u.password, true
}
return "", false
return u.password, u.passwordSet
}
// String returns the encoded userinfo information in the standard form