mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
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:
parent
5df7f5220f
commit
4383e4387b
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue