1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Properly scope Config to the wtf package and remove it as a dependency from everywhere else

This commit is contained in:
Chris Cummer
2018-06-16 14:59:22 -07:00
parent abedee0ce0
commit 66b69471d0
42 changed files with 126 additions and 251 deletions

View File

@@ -4,13 +4,9 @@ import (
"fmt"
"strings"
"github.com/olebedev/config"
"github.com/senorprogrammer/wtf/wtf"
)
// Config is a pointer to the global config object
var Config *config.Config
type Widget struct {
wtf.TextWidget
}
@@ -45,7 +41,7 @@ func (widget *Widget) Refresh() {
func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string {
str := ""
displayEmpty := Config.UBool("wtf.mods.opsgenie.displayEmpty", true)
displayEmpty := wtf.Config.UBool("wtf.mods.opsgenie.displayEmpty", true)
for _, data := range onCallResponse.OnCallData {
if (len(data.Recipients) == 0) && (displayEmpty == false) {