From 0c4f259f6a93d9effdcc3dcf2ace30a0f56c791e Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 10 Dec 2019 18:17:29 +0100 Subject: [PATCH] Keep errors lowercase --- baseelement.go | 4 ++-- listitem.go | 1 - style.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/baseelement.go b/baseelement.go index 939d3cd..71cf4c3 100644 --- a/baseelement.go +++ b/baseelement.go @@ -22,7 +22,7 @@ type BaseElement struct { func color(c *string) (uint8, error) { if c == nil || len(*c) == 0 { - return 0, errors.New("Invalid color") + return 0, errors.New("invalid color") } if (*c)[0] == '#' { i, err := hexToANSIColor(*c) @@ -61,7 +61,7 @@ func colorSeq(fg *string, bg *string) (string, error) { return seq + bs + "m", nil } - return "", errors.New("Invalid color") + return "", errors.New("invalid color") } func formatToken(format string, token string) (string, error) { diff --git a/listitem.go b/listitem.go index 48896b0..789047c 100644 --- a/listitem.go +++ b/listitem.go @@ -13,7 +13,6 @@ type ItemElement struct { func (e *ItemElement) Render(w io.Writer, ctx RenderContext) error { var el *BaseElement if e.Enumeration > 0 { - el = &BaseElement{ Token: e.Text, Style: ctx.style[Enumeration], diff --git a/style.go b/style.go index d5dc1bc..56fb4d7 100644 --- a/style.go +++ b/style.go @@ -295,6 +295,6 @@ func keyToType(key string) (StyleType, error) { return TableRow, nil default: - return 0, fmt.Errorf("Invalid style element type: %s", key) + return 0, fmt.Errorf("invalid style element type: %s", key) } }