From c465e434caf2c70c6f21e23919585582034af45b Mon Sep 17 00:00:00 2001 From: Stefan Wiedemann Date: Tue, 18 Oct 2022 10:42:20 +0200 Subject: [PATCH] Init (#5) * add code * add ci * fix dependency * fix target repo * fix cert reading * fix --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 24792fe..df779f7 100644 --- a/main.go +++ b/main.go @@ -108,11 +108,11 @@ func getEncodedCertificate(credentialsFolderPath string) (encodedCert []string, return encodedCert, err } - certString := strings.Trim(string(cert), "-----END CERTIFICATE-----") - certArray := strings.Split(certString, "-----BEGIN CERTIFICATE-----") + certString := strings.ReplaceAll(string(cert), "-----END CERTIFICATE-----\n", "") + certArray := strings.Split(certString, "-----BEGIN CERTIFICATE-----\n") for i := range certArray { - certArray[i] = strings.Trim(certArray[i], "-----BEGIN CERTIFICATE-----") + certArray[i] = strings.ReplaceAll(certArray[i], "-----BEGIN CERTIFICATE-----\n", "") } return certArray, err