From c34e89aec769b68922fec8a46c218d98fb33ce82 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 27 Jul 2020 10:33:39 +0200 Subject: [PATCH] getEncodedPassword: simplify encodedPassword return --- post-processor/vsphere/post-processor.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/post-processor/vsphere/post-processor.go b/post-processor/vsphere/post-processor.go index 39cc4ee58..ff6615ebb 100644 --- a/post-processor/vsphere/post-processor.go +++ b/post-processor/vsphere/post-processor.go @@ -148,8 +148,7 @@ func getEncodedPassword(u *url.URL) (string, bool) { // filter password from all logging password, passwordSet := u.User.Password() if passwordSet && password != "" { - encodedUserPassword := strings.Split(u.User.String(), ":") - encodedPassword := encodedUserPassword[len(encodedUserPassword)-1] + encodedPassword := strings.Split(u.User.String(), ":")[1] return encodedPassword, true } return password, false