util

package
v0.0.0-...-667c717 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package util provides generally helpful functions used by the ipgs system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FatalIfErr

func FatalIfErr(note string, err error)

FatalIfErr uses log.Fatalln to halt execution if err is not nil with the message "failed to [note]: [err]"

func GetBoolForPrompt

func GetBoolForPrompt(prompt string, def bool) (bool, error)

GetBoolForPrompt writes a prompt to STDOUT and expects a "y" or a "n" in response. Returns true if "y" was entered, otherwise returns false.

func GetIntForPrompt

func GetIntForPrompt(prompt string, def int) (int, error)

GetIntForPromt writes a prompt to STDOUT and expects an integer in response. Returns the input converted to an integer if possible, or an error if not.

func GetStringForPrompt

func GetStringForPrompt(prompt, def string) (string, error)

GetStringForPrompt writes a prompt to STDOUT and returns the string entered into STDIN. If the user does not enter anything, the default string is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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