Apply suggestions from code review

Co-Authored-By: mgritter <mgritter@gmail.com>
This commit is contained in:
Jim Kalafut 2019-05-02 18:02:15 -05:00 committed by GitHub
parent 4e22fb6704
commit 2835131117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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{

View File

@ -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)