diff --git a/email.go b/email.go index eedef16..4e7a0b6 100644 --- a/email.go +++ b/email.go @@ -9,7 +9,6 @@ import ( htmltemplate "html/template" txttemplate "html/template" "io" - "path" "strings" "github.com/pkg/errors" @@ -36,27 +35,6 @@ type Email struct { funcMap map[string]interface{} } -// NewEmail renderer -func NewEmail(mountPath, overridePath string) *Email { - e := &Email{ - mountPath: mountPath, - overridePath: overridePath, - htmlTemplates: make(map[string]*htmltemplate.Template), - txtTemplates: make(map[string]*txttemplate.Template), - funcMap: txttemplate.FuncMap{ - "title": strings.Title, - "mountpathed": func(location string) string { - if mountPath == "/" { - return location - } - return path.Join(mountPath, location) - }, - }, - } - - return e -} - // Load a template func (e *Email) Load(names ...string) error { for _, n := range names { @@ -86,7 +64,7 @@ func (e *Email) Load(names ...string) error { } // Render a view -func (e *Email) Render(ctx context.Context, page string, data authboss.HTMLData) (output []byte, contentType string, err error) { +func (e *Email) Render(_ context.Context, page string, data authboss.HTMLData) (output []byte, contentType string, err error) { buf := &bytes.Buffer{} var exe executor diff --git a/html.go b/html.go index 06bd858..932d30d 100644 --- a/html.go +++ b/html.go @@ -87,7 +87,7 @@ func (h *HTML) Load(names ...string) error { } // Render a view -func (h *HTML) Render(ctx context.Context, page string, data authboss.HTMLData) (output []byte, contentType string, err error) { +func (h *HTML) Render(_ context.Context, page string, data authboss.HTMLData) (output []byte, contentType string, err error) { buf := &bytes.Buffer{} tpl, ok := h.templates[page]