make case insensative

This commit is contained in:
Hayden 2024-01-05 13:58:17 -06:00
parent c1bcb80860
commit d1b8b5eea2
No known key found for this signature in database
GPG key ID: 17CF79474E257545

View file

@ -8,6 +8,7 @@ import (
"encoding/json" "encoding/json"
"io" "io"
"slices" "slices"
"strings"
"sync" "sync"
) )
@ -89,8 +90,10 @@ func (cs *CurrencyRegistry) Slice() []Currency {
} }
func (cs *CurrencyRegistry) IsSupported(code string) bool { func (cs *CurrencyRegistry) IsSupported(code string) bool {
lower := strings.ToLower(code)
cs.mu.RLock() cs.mu.RLock()
defer cs.mu.RUnlock() defer cs.mu.RUnlock()
_, ok := cs.registry[code] _, ok := cs.registry[lower]
return ok return ok
} }