Skip to content
Snippets Groups Projects
Commit 8e90c2bc authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

made the emoji init code simpler

parent 72374d06
No related branches found
No related tags found
5 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!371[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast,!354Channels impl,!340Project/channels
...@@ -9,7 +9,6 @@ package channels ...@@ -9,7 +9,6 @@ package channels
import ( import (
"bytes" "bytes"
jww "github.com/spf13/jwalterweatherman"
"regexp" "regexp"
) )
...@@ -21,12 +20,7 @@ var compiledRegex *regexp.Regexp ...@@ -21,12 +20,7 @@ var compiledRegex *regexp.Regexp
// compile the regular expression in an init so it is only // compile the regular expression in an init so it is only
// compiled once // compiled once
func init() { func init() {
var err error compiledRegex = regexp.MustCompile(findEmoji)
compiledRegex, err = regexp.Compile(findEmoji)
if err != nil {
jww.FATAL.Panicf("failed to compile the regex for emoji finding " +
"within channels")
}
} }
// ValidateReaction checks that the reaction only contains a single emoji. // ValidateReaction checks that the reaction only contains a single emoji.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment