From dab9d3f80286dfc493442e6f0b1c7809873ca602 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Tue, 19 Nov 2019 12:37:26 +0200 Subject: [PATCH] Cleanup --- Makefile | 2 -- command.go | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a2fa54a3..94b56016 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,6 @@ all: testdeps go test ./... -run=NONE -bench=. -benchmem env GOOS=linux GOARCH=386 go test ./... go vet - go get github.com/gordonklaus/ineffassign - ineffassign . golangci-lint run testdeps: testdata/redis/src/redis-server diff --git a/command.go b/command.go index 83b4651f..76ca15ac 100644 --- a/command.go +++ b/command.go @@ -2005,12 +2005,15 @@ func (c *cmdsInfoCache) Get() (map[string]*CommandInfo, error) { if err != nil { return err } - for key := range cmds { - lowerKey := internal.ToLower(key) - if key != lowerKey { - cmds[lowerKey] = cmds[key] + + // Extensions have cmd names in upper case. Convert them to lower case. + for k, v := range cmds { + lower := internal.ToLower(k) + if lower != k { + cmds[lower] = v } } + c.cmds = cmds return nil })