-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94e85c5
commit a45dac3
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ansi | ||
|
||
// Error - print error message | ||
func Error(msg ...interface{}) *Color { | ||
return (&Color{}).Error(msg...) | ||
} | ||
|
||
// Errorf - print error message | ||
func Errorf(format string, msg ...interface{}) *Color { | ||
return (&Color{}).Errorf(format, msg...) | ||
} | ||
|
||
// Errorln - print error message | ||
func Errorln(msg ...interface{}) *Color { | ||
return (&Color{}).Errorln(msg...) | ||
} | ||
|
||
// Error - print error message | ||
func (c *Color) Error(msg ...interface{}) *Color { | ||
c.Red().Print("[ERROR]: ") | ||
for _, m := range msg { | ||
c.Print(m.(string)) | ||
} | ||
return c | ||
} | ||
|
||
// Errorf - print error message | ||
func (c *Color) Errorf(format string, msg ...interface{}) *Color { | ||
return Red().Printf("[ERROR]: "+format, msg...) | ||
} | ||
|
||
// Errorln - print error message | ||
func (c *Color) Errorln(msg ...interface{}) *Color { | ||
return c.Errorln(msg...).LF() | ||
} |