Categorygithub.com/gleich/statuser/v2
modulepackage
2.5.0
Repository: https://github.com/gleich/statuser.git
Documentation: pkg.go.dev

# README

statuser GitHub release (latest by date including pre-releases)

šŸ“£ A user-friendly status outputting library for go

build lint test

šŸš€ Installing

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

go get -u github.com/gleich/statuser/v2

šŸ“š Documentation GoDoc

Here is some basic usage:

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

ErrorMsg()

Output an error to the user with just a message

Parameters

  1. message
    • Type: string
    • Description: A human readable message to help the user
  2. exitCode
    • Type: int
    • Description: Exit code used to exit the program

Example

Outputs the following in red text:

ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘
ā–‘šŸšØ ERROR šŸšØā–‘
ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘

message
exit status 1

Warning()

Output a warning 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()

Output a warning the user

Parameters

  1. message
    • Type: string
    • Description: The success message to display to the user

Example

Outputs the following text in green:

āœ… message

Contributors

  1. Matthew Gleich (@gleich)

šŸ‘„ Contributors

# Functions

Output an error to the user.
Output an error to the user.
Output a success to the user.
Output a warning to the user.

# Variables

If the output should use emojis.
Error box character.
Error character if emojis are turned off.
Error emoji.
Error text.
Warning character if emojis are turned off.
Success emoji.
Warning text.
Warning character if emojis are turned off.
Warning emoji.
Warning text.