diff options
| author | Antonio Murdaca <runcom@redhat.com> | 2016-06-26 12:14:41 +0200 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-09-26 00:41:28 +0000 |
| commit | 4383e4387b30ffbd8f85f053e399d53d7eef9330 (patch) | |
| tree | 97595574061dc1b8a3fbc077132cb5f84f73a377 /src/net | |
| parent | 5df7f5220f42cb283147ab271cd965720e233759 (diff) | |
| download | go-4383e4387b30ffbd8f85f053e399d53d7eef9330.tar.xz | |
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>
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/url/url.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net/url/url.go b/src/net/url/url.go index d77e9295dd..8824c99ddc 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -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 |
