interact: fix missing make()

This commit is contained in:
Andy Cheng 2022-06-06 15:36:09 +08:00
parent dae4afec10
commit 3d9994706b

View File

@ -54,6 +54,7 @@ func getStrategySignatures(exchangeStrategies map[string]SingleExchangeStrategy)
func filterStrategyByInterface(checkInterface interface{}, exchangeStrategies map[string]SingleExchangeStrategy) (strategies map[string]SingleExchangeStrategy, found bool) {
found = false
strategies = make(map[string]SingleExchangeStrategy)
rt := reflect.TypeOf(checkInterface).Elem()
for signature, strategy := range exchangeStrategies {
if ok := reflect.TypeOf(strategy).Implements(rt); ok {
@ -412,7 +413,7 @@ func getStrategySignature(strategy SingleExchangeStrategy) (string, error) {
var signature = path.Base(rv.Type().PkgPath())
var id = strategy.ID()
id := callID(strategy)
if !strings.EqualFold(id, signature) {
signature += "." + strings.ToLower(id)