From 699b413b2a9c3bd3a2f279014c1f7e268c198437 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 25 Jan 2019 12:24:57 +0100 Subject: [PATCH] lint --- colors.go | 2 ++ printer.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/colors.go b/colors.go index eca0f23..9a9e914 100644 --- a/colors.go +++ b/colors.go @@ -8,6 +8,8 @@ import ( type terminalColor uint32 +// Theme is used to associate color names to integer color values ; +// the color names in the theme are available in the colorizing format type Theme map[string]terminalColor var theme Theme = make(map[string]terminalColor) diff --git a/printer.go b/printer.go index 95f25c4..bb83fa2 100644 --- a/printer.go +++ b/printer.go @@ -30,8 +30,8 @@ func Sprintf(format string, a ...interface{}) (string, error) { cursor = match[1] // (2) extract features + var err error var ( - err = error(nil) text = "" sForeground = "" sBackground = "" @@ -76,6 +76,7 @@ func Sprintf(format string, a ...interface{}) (string, error) { return output, nil } +// Printf prints a terminal-colorized output following the coloring format func Printf(format string, a ...interface{}) error { s, err := Sprintf(format, a...) if err != nil {