ext

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Green

func Green(s string) string

Green returns the string s wrapped in ANSI color codes for green.

Parameters:

  • s: the string to color

Returns:

  • the string s wrapped in ANSI color codes for green

func Red

func Red(s string) string

Red returns the string s wrapped in ANSI color codes for red.

Parameters:

  • s: the string to color

Returns:

  • the string s wrapped in ANSI color codes for red

func Ternary

func Ternary[T any](condition bool, first T, second T) T

Ternary is a simple ternary operator for Go. It returns the first value if the condition is true, otherwise the second value.

Parameters:

  • condition: the condition to check
  • first: the value to return if the condition is true
  • second: the value to return if the condition is false

Returns:

  • the first value if the condition is true, otherwise the second value

func Yellow

func Yellow(s string) string

Yellow returns the string s wrapped in ANSI color codes for yellow.

Parameters:

  • s: the string to color

Returns:

  • the string s wrapped in ANSI color codes for yellow

Types

This section is empty.

Jump to

Keyboard shortcuts

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