From a7a28ec98469e48eb137553d5c2321d5f2d5ebf3 Mon Sep 17 00:00:00 2001 From: Simon Aronsson Date: Sat, 3 Oct 2020 22:25:17 +0200 Subject: [PATCH] fix fmt and vetting issues --- cmd/root.go | 2 +- pkg/container/mocks/FilterableContainer.go | 1 - pkg/filters/filters.go | 2 +- pkg/notifications/email.go | 2 +- pkg/notifications/shoutrrr.go | 4 ++-- pkg/notifications/shoutrrr_test.go | 1 - 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 3b94153aa..9318b1266 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 107ca1b0a..1ae812535 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 bc6faa27e..0e37885f6 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 bba2b8248..6079de77b 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 cd6359b24..d16808dda 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 8bba2d3a5..47334af55 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)