From 621dbf2ed96f4d1cd3b4320f95171f56c55ca81e Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Wed, 23 Nov 2016 15:58:21 +0100 Subject: [PATCH 1/2] Added black and white colors --- color.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/color.go b/color.go index 3896fe9..4057961 100644 --- a/color.go +++ b/color.go @@ -57,6 +57,16 @@ func bold(message string) string { return fmt.Sprintf("\x1b[1m%s\x1b[21m", message) } +// Black returns a black string +func Black(message string) string { + return fmt.Sprintf("\x1b[30m%s\x1b[0m", message) +} + +// White returns a white string +func White(message string) string { + return fmt.Sprintf("\x1b[37m%s\x1b[0m", message) +} + // Cyan returns a cyan string func Cyan(message string) string { return fmt.Sprintf("\x1b[36m%s\x1b[0m", message) @@ -92,6 +102,16 @@ func Magenta(message string) string { return fmt.Sprintf("\x1b[35m%s\x1b[0m", message) } +// BlackBold returns a black bold string +func BlackBold(message string) string { + return fmt.Sprintf("\x1b[30m%s\x1b[0m", bold(message)) +} + +// WhiteBold returns a white bold string +func WhiteBold(message string) string { + return fmt.Sprintf("\x1b[37m%s\x1b[0m", bold(message)) +} + // CyanBold returns a cyan bold string func CyanBold(message string) string { return fmt.Sprintf("\x1b[36m%s\x1b[0m", bold(message)) From 1c0a56911665f07b12b6c942b3fd1d17f1ad61b5 Mon Sep 17 00:00:00 2001 From: Faissal Elamraoui Date: Wed, 23 Nov 2016 15:58:38 +0100 Subject: [PATCH 2/2] Fixed a typo --- watch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watch.go b/watch.go index a030c3b..b660fe9 100644 --- a/watch.go +++ b/watch.go @@ -96,7 +96,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) { } -// getFileModTime retuens unix timestamp of `os.File.ModTime` by given path. +// getFileModTime returns unix timestamp of `os.File.ModTime` for the given path. func getFileModTime(path string) int64 { path = strings.Replace(path, "\\", "/", -1) f, err := os.Open(path)