Cute Print

a cute Go print package (fmt alternative), minimalist, no dependencies!

Installation

go get -u github.com/zakaria-chahboun/cute

The idea is to simplify the printing of messages in the terminal, especially in error case. Letting you to put a title for your message in different colors.

Print line

cute.Println("Hi everyone", "My name is Zakaria!")

Screenshot

print line

As you see the default color for the title is bright yellow and for the message is bright purple.

Print muti-lines

cute.Printlines("Hi everyone", "My name is Zakaria!", "Zaki is my nick name.")

Screenshot

print line

Check errors

The cute.Check(..) is useful in case of errors, especially if you have a lot of functions in you code. It will help you to print a clear error code.

// equal to (if error != nil)
cute.Check("Error Title", errors.New("This is a cute panic!"))

Screenshot

print line

Change colors

You can change the color:

  • ColorReset

  • ColorDefault

  • ColorBlack / ColorBrightBlack

  • ColorRed / ColorBrightRed

  • ColorYellow / ColorBrightYellow

  • ColorGreen / ColorBrightGreen

  • ColorBlue / ColorBrightBlue

  • ColorPurple / ColorBrightPurple

  • ColorCyan / ColorBrightCyan

  • ColorWhite / ColorBrightWhite

cute.SetTitleColor(cute.ColorBrightBlue)
cute.SetMessageColor(cute.ColorBrightGreen)
cute.Println("Hi everyone", "My name is Zakaria!")

Screenshot

print line

Printf

cute.Printf("Another title", "%s, a Country in North Africa.\n", "Morocco")

Screenshot

print line


GitHub

View Github