aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAntonio Murdaca <runcom@redhat.com>2016-06-26 12:14:41 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2016-09-26 00:41:28 +0000
commit4383e4387b30ffbd8f85f053e399d53d7eef9330 (patch)
tree97595574061dc1b8a3fbc077132cb5f84f73a377 /src/net
parent5df7f5220f42cb283147ab271cd965720e233759 (diff)
downloadgo-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.go5
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