From 48278c8e77940959b6d2fea9d1fbab718016e6c0 Mon Sep 17 00:00:00 2001 From: probandula Date: Fri, 28 Oct 2016 16:15:07 +0200 Subject: [PATCH] add badge, few improvements --- README.md | 3 +-- cmd/figlet4go/figlet4go.go | 4 ++-- font.go | 2 +- fontmanager.go | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 02cd0e8..4bdc927 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,9 @@ `figlet4go` is a go library forked from [getwe/figlet4go](https://github.com/getwe/figlet4go) which is a port of [FIGlet](http://www.figlet.org/) to Golang. With `figlet4go` it's easy to create **ascii text banners** in the command-line or with the given api. - - ![screenshot](./screenshot/figlet4go.png) +[![Go Report Card](https://goreportcard.com/badge/github.com/probandula/figlet4go)](https://goreportcard.com/report/github.com/probandula/figlet4go) ## Installation diff --git a/cmd/figlet4go/figlet4go.go b/cmd/figlet4go/figlet4go.go index b7ee8bb..8907280 100644 --- a/cmd/figlet4go/figlet4go.go +++ b/cmd/figlet4go/figlet4go.go @@ -14,7 +14,7 @@ var ( str *string = flag.String("str", "", "String to be converted with FIGlet") font *string = flag.String("font", "", "Font name to use") fontpath *string = flag.String("fontpath", "", "Font path to load fonts from") - colors *string = flag.String("colors", "", "Character colors seperated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white") + colors *string = flag.String("colors", "", "Character colors separated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white") ) func main() { @@ -54,7 +54,7 @@ func main() { } // Get a slice with colors to give to the RenderOptions -// Splits the given string with the seperator ";" +// Splits the given string with the separator ";" func getColorSlice(colorStr string) []color.Attribute { givenColors := strings.Split(colorStr, ";") diff --git a/font.go b/font.go index d3f69c6..b224a9d 100644 --- a/font.go +++ b/font.go @@ -1,3 +1,4 @@ +package figlet4go // Explanation of the .flf file header // THE HEADER LINE // @@ -16,7 +17,6 @@ // * The two layout parameters are closely related and fairly complex. // (See "INTERPRETATION OF LAYOUT PARAMETERS".) // -package figlet4go import ( "strings" diff --git a/fontmanager.go b/fontmanager.go index 07daed6..4a8e9e6 100644 --- a/fontmanager.go +++ b/fontmanager.go @@ -85,9 +85,9 @@ func (fm *fontManager) loadFontList(fontPath string) error { // Load a font from disk // The font must be registered in the fontList -func (this *fontManager) loadDiskFont(fontName string) error { +func (fm *fontManager) loadDiskFont(fontName string) error { // Get the fontpath - path, ok := this.fontList[fontName] + path, ok := fm.fontList[fontName] // Font is not registered if !ok { return errors.New("Font Not Found: " + fontName) @@ -106,7 +106,7 @@ func (this *fontManager) loadDiskFont(fontName string) error { } // Register the font object in the fontLib - this.fontLib[fontName] = font + fm.fontLib[fontName] = font return nil }