4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-04 13:37:44 +00:00

Fix tests and make megacheck happy

This commit is contained in:
Wim
2018-03-05 00:30:46 +01:00
parent f2f1d874e1
commit 98027446c8
4 changed files with 29 additions and 34 deletions

View File

@ -23,7 +23,6 @@ import (
"github.com/hashicorp/golang-lru"
"github.com/peterhellberg/emojilib"
"net/http"
"reflect"
"regexp"
"strings"
"time"
@ -450,14 +449,6 @@ func getChannelID(msg config.Message) string {
return msg.Channel + msg.Account
}
//getField returns the Protocol configuration for a specific protocol (field)
func getField(cfg *config.Config, field string) map[string]config.Protocol {
r := reflect.ValueOf(cfg)
f := reflect.Indirect(r).FieldByName(field)
i := f.Interface()
return i.(map[string]config.Protocol)
}
func isApi(account string) bool {
return strings.HasPrefix(account, "api.")
}