diff --git a/templateProvider.go b/templateProvider.go index 7567da8..2b37181 100644 --- a/templateProvider.go +++ b/templateProvider.go @@ -1,7 +1,6 @@ package diago import ( - "errors" "html/template" "strings" ) @@ -25,9 +24,6 @@ func (p DefaultTemplateProvider) GetTemplate() string { func (d *DefaultPanelGenerator) GenerateHTML(name string, templateProvider TemplateProvider, data interface{}) (string, error) { templateContent := templateProvider.GetTemplate() tp := template.New(name) - if tp == nil { - return "", errors.New("Bad template name") - } tpl, err := tp.Parse(templateContent) if err != nil { return "", err diff --git a/tests/template_test.go b/tests/template_test.go index 578e6af..75c8839 100644 --- a/tests/template_test.go +++ b/tests/template_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "html/template" - "log" _ "log" "net/http" "net/http/httptest" @@ -66,10 +65,6 @@ func TestGenerateHTML_ParseError(t *testing.T) { result, err := d.GenerateHTML("diagoPanel", mockTemplateProvider, nil) - log.Printf("Result: %s", result) - - log.Printf("Err: %t", err != nil) - log.Printf("Err: %v", err) assert.Empty(t, result) assert.Error(t, err) assert.Contains(t, err.Error(), "unclosed action")