From fdc0f042682ae017a2706861a77319ebf3d81b3a Mon Sep 17 00:00:00 2001 From: HuKeping Date: Mon, 18 Jan 2016 19:58:02 +0800 Subject: [PATCH] Keep code style consistent GetLeafCerts and GetIntermediaCerts are similiar and a consistent implementation will be more friendly to those people who wants to read the code. Signed-off-by: Hu Keping --- trustmanager/x509utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trustmanager/x509utils.go b/trustmanager/x509utils.go index 35bd528bcc..02e1b4f4c6 100644 --- a/trustmanager/x509utils.go +++ b/trustmanager/x509utils.go @@ -205,7 +205,8 @@ func GetLeafCerts(certs []*x509.Certificate) []*x509.Certificate { // GetIntermediateCerts parses a list of x509 Certificates and returns all of the // ones marked as a CA, to be used as intermediates -func GetIntermediateCerts(certs []*x509.Certificate) (intCerts []*x509.Certificate) { +func GetIntermediateCerts(certs []*x509.Certificate) []*x509.Certificate { + var intCerts []*x509.Certificate for _, cert := range certs { if cert.IsCA { intCerts = append(intCerts, cert)