msg

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: GPL-3.0 Imports: 3 Imported by: 1

README

Go Reference Go Report Card REUSE status

Go Utilities: msg

Go package with utilities that support displaying messages on the command line.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintErrorln

func PrintErrorln(format string, a ...interface{})

PrintErrorln prints an error

func PrintInfoln

func PrintInfoln(format string, a ...interface{})

PrintInfoln prints an info text

func PrintMsgln

func PrintMsgln(format string, a ...interface{})

PrintMsgln prints a message

func PrintPlainln

func PrintPlainln(format string, a ...interface{})

PrintPlainln prints a plain text

func PrintWarnln

func PrintWarnln(format string, a ...interface{})

PrintWarnln prints a warning

func ProgressStr

func ProgressStr(msg string, interval time.Duration) (chan<- struct{}, <-chan struct{})

ProgressStr shows and moves a bar '...' on the command line. It can be used to show that an activity is ongoing. The parameter 'interval' steers the refresh rate (in milli seconds). The text in 'msg' is displayed in form of '...'. The progress bar is stopped by sending an empty struct to the returned channel:

chan <- struct{}{}
close(chan)

func UserOK

func UserOK(s string) bool

UserOK print the message s followed by " (Y/n)?" on stdout and askes the user to press either Y (to continue) or n (to stop). Y is treated as default. I.e. if the user only presses return, that's interpreted as if he has pressed Y.

Types

This section is empty.

Jump to

Keyboard shortcuts

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