formatters

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package formatters houses the build-in formatter functions that are registered with please

Index

Constants

View Source
const INDENT = "  "

Variables

This section is empty.

Functions

func Names

func Names() []string

Names returns a sorted list of valid options for the "format" parameter of Format

func Register

func Register(name string, formatter Formatter) error

Register assigns a Formatter function to a name. If the name has already been registered, an error will be returned.

Types

type Formatter

type Formatter func(interface{}) (string, error)

Type Formatter is a function that takes an interface{} and attempts to format it as a string

func Get

func Get(name string) (Formatter, error)

Get returns a Formatter function by name. If the named formatter is not found, an error will be returned.

Jump to

Keyboard shortcuts

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