statuser

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 4 Imported by: 1

README ΒΆ

statuser

πŸ“£ A user friendly status outputting library for go

Format Go Test

πŸš€ Installing

Simply run the command below in the root of your go project:

go get -u github.com/Matt-Gleich/statuser

πŸ“š Documentation

Emojis

By default emojis are turned on. If you wish to disable them then just do emojis = false in your go code.

Error()

Output an error to the user

Parameters
  1. message
    • Type: string
    • Description: A human readable message to help the user
  2. err
    • Type: err
    • Description: The golang error
  3. exitCode
    • Type: int
    • Description: Exit code used to exit the program
Example

Outputs the following in red text:

β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘πŸš¨ ERROR πŸš¨β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘

message

GOLANG ERROR (SHOW DEVELOPER):
err
exit status 1
Warning()

Output a warning the the user

Parameters
  1. message
    • Type: string
    • Description: The warning message to display to the user
Example

Outputs the following text in yellow:

⚠️ WARNING ⚠️
message
Success()
Parameters
  1. message
    • Type: string
    • Description: The success message to display to the user
Example

Outputs the following text in green:

βœ… SUCCESS βœ…
message

Contributors

  1. Matthew Gleich (@Matt-Gleich)

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var Emojis = true

Emojis ... If the output should use emojis

Functions ΒΆ

func Error ΒΆ

func Error(message string, err error, exitCode int)

Error ... Output an error to the user

func Success ΒΆ

func Success(message string)

Success ... Output a success to the user

func Warning ΒΆ

func Warning(message string)

Warning ... Output a warning to the user

Types ΒΆ

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL