aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-01-20 22:06:47 +0100
committerSimon Ser <contact@emersion.fr>2020-01-20 22:06:47 +0100
commit3347e69480b8b033354fcc94782818d091b253e3 (patch)
treee28d00ff99cd2bfaad55de2482799eae7662c166
parent9fdccc3a4beaf36195a14d7dd17801681f93d45b (diff)
downloadalps-3347e69480b8b033354fcc94782818d091b253e3.tar.gz
alps-3347e69480b8b033354fcc94782818d091b253e3.zip
Use %q to quote values in format strings
-rw-r--r--renderer.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/renderer.go b/renderer.go
index b229d34..a8f2e51 100644
--- a/renderer.go
+++ b/renderer.go
@@ -99,13 +99,13 @@ func (r *renderer) Render(w io.Writer, name string, data interface{}, ectx echo.
var ok bool
renderData, ok = data.(RenderData)
if !ok {
- return fmt.Errorf("data passed to template '%v' doesn't implement RenderData", name)
+ return fmt.Errorf("data passed to template %q doesn't implement RenderData", name)
}
}
for _, plugin := range ctx.Server.plugins {
if err := plugin.Inject(ctx, name, renderData); err != nil {
- return fmt.Errorf("failed to run plugin '%v': %v", plugin.Name(), err)
+ return fmt.Errorf("failed to run plugin %q: %v", plugin.Name(), err)
}
}
@@ -136,7 +136,7 @@ func (r *renderer) Load(plugins []Plugin) error {
for _, p := range plugins {
if err := p.LoadTemplate(base); err != nil {
- return fmt.Errorf("failed to load template for plugin '%v': %v", p.Name(), err)
+ return fmt.Errorf("failed to load template for plugin %q: %v", p.Name(), err)
}
}
@@ -152,16 +152,16 @@ func (r *renderer) Load(plugins []Plugin) error {
continue
}
- r.logger.Printf("Loading theme '%v'", fi.Name())
+ r.logger.Printf("Loading theme %q", fi.Name())
var err error
if themes[fi.Name()], err = loadTheme(fi.Name(), base); err != nil {
- return fmt.Errorf("failed to load theme '%v': %v", fi.Name(), err)
+ return fmt.Errorf("failed to load theme %q: %v", fi.Name(), err)
}
}
if r.defaultTheme != "" {
if _, ok := themes[r.defaultTheme]; !ok {
- return fmt.Errorf("failed to find default theme '%v'", r.defaultTheme)
+ return fmt.Errorf("failed to find default theme %q", r.defaultTheme)
}
}