From 4383e4387b30ffbd8f85f053e399d53d7eef9330 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Sun, 26 Jun 2016 12:14:41 +0200 Subject: [PATCH] net/url: avoid if statement Change-Id: I894a8f49d29dbb6f9265e4b3df5767318b225460 Signed-off-by: Antonio Murdaca Reviewed-on: https://go-review.googlesource.com/24492 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/url/url.go | 5 +---- 1 file changed, 1 insertion(+), 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 -- 2.48.1