diff --git a/cmd/root.go b/cmd/root.go index 3b94153..9318b12 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -31,7 +31,7 @@ var ( timeout time.Duration lifecycleHooks bool rollingRestart bool - scope string + scope string ) var rootCmd = &cobra.Command{ diff --git a/pkg/container/mocks/FilterableContainer.go b/pkg/container/mocks/FilterableContainer.go index 107ca1b..1ae8125 100644 --- a/pkg/container/mocks/FilterableContainer.go +++ b/pkg/container/mocks/FilterableContainer.go @@ -78,4 +78,3 @@ func (_m *FilterableContainer) Scope() (string, bool) { return r0, r1 } - diff --git a/pkg/filters/filters.go b/pkg/filters/filters.go index bc6faa2..0e37885 100644 --- a/pkg/filters/filters.go +++ b/pkg/filters/filters.go @@ -56,7 +56,7 @@ func FilterByScope(scope string, baseFilter t.Filter) t.Filter { if scope == "" { return baseFilter } - + return func(c t.FilterableContainer) bool { containerScope, ok := c.Scope() if ok && containerScope == scope { diff --git a/pkg/notifications/email.go b/pkg/notifications/email.go index bba2b82..6079de7 100644 --- a/pkg/notifications/email.go +++ b/pkg/notifications/email.go @@ -154,4 +154,4 @@ func (e *emailTypeNotifier) Fire(entry *log.Entry) error { return nil } -func (e *emailTypeNotifier) Close() {} \ No newline at end of file +func (e *emailTypeNotifier) Close() {} diff --git a/pkg/notifications/shoutrrr.go b/pkg/notifications/shoutrrr.go index cd6359b..d16808d 100644 --- a/pkg/notifications/shoutrrr.go +++ b/pkg/notifications/shoutrrr.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" "github.com/containrrr/shoutrrr/pkg/types" + "strings" "text/template" - "strings" "github.com/containrrr/shoutrrr" t "github.com/containrrr/watchtower/pkg/types" @@ -136,7 +136,7 @@ func getShoutrrrTemplate(c *cobra.Command) *template.Template { funcs := template.FuncMap{ "ToUpper": strings.ToUpper, "ToLower": strings.ToLower, - "Title": strings.Title, + "Title": strings.Title, } // If we succeed in getting a non-empty template configuration diff --git a/pkg/notifications/shoutrrr_test.go b/pkg/notifications/shoutrrr_test.go index 8bba2d3..47334af 100644 --- a/pkg/notifications/shoutrrr_test.go +++ b/pkg/notifications/shoutrrr_test.go @@ -75,7 +75,6 @@ func TestShoutrrrStringFunctions(t *testing.T) { require.Equal(t, "INFO: foo bar Foo Bar\n", s) } - func TestShoutrrrInvalidTemplateUsesTemplate(t *testing.T) { cmd := new(cobra.Command)