From 2835131117f0faa333365a9d8e56db347b11be86 Mon Sep 17 00:00:00 2001 From: Jim Kalafut Date: Thu, 2 May 2019 18:02:15 -0500 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: mgritter --- builtin/logical/pki/cert_util_test.go | 4 ++-- sdk/helper/strutil/strutil.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/logical/pki/cert_util_test.go b/builtin/logical/pki/cert_util_test.go index ed815915c..1a4be58cc 100644 --- a/builtin/logical/pki/cert_util_test.go +++ b/builtin/logical/pki/cert_util_test.go @@ -126,10 +126,10 @@ func TestPki_FetchCertBySerial(t *testing.T) { } } -// Demonstrate that multiple OUs in the name are handled in an +// Demonstrate that multiple OUs in the name are handled in an // order-preserving way. func TestPki_MultipleOUs(t *testing.T) { - var b backend; + var b backend fields := addCACommonFields(map[string]*framework.FieldSchema{}) apiData := &framework.FieldData{ diff --git a/sdk/helper/strutil/strutil.go b/sdk/helper/strutil/strutil.go index 7e8e31c79..b16435bdc 100644 --- a/sdk/helper/strutil/strutil.go +++ b/sdk/helper/strutil/strutil.go @@ -244,8 +244,8 @@ func RemoveDuplicates(items []string, lowercase bool) []string { // In all cases, strings are compared after trimming whitespace // If caseInsensitive, strings will be compared after ToLower() func RemoveDuplicatesStable(items []string, caseInsensitive bool) []string { - itemsMap := map[string]bool{} - deduplicated := make([]string, 0, len(itemsMap)) + itemsMap := make(map[string]bool, len(items)) + deduplicated := make([]string, 0, len(items)) for _, item := range items { key := strings.TrimSpace(item)