strings

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToPath

func AppendToPath(originalPath string, toAppend ...string) string

AppendToPath appends one or more paths to the specified original path.

func IsASCIIIdentifier

func IsASCIIIdentifier(s string) bool

IsASCIIIdentifier takes a string and returns true if the string does not contain any special characters.

func NormalizeURL

func NormalizeURL(s string) (string, error)

NormalizeURL uses purell's "usually safe normalization" algorithm to normalize URLs. This includes removing dot segments, removing trailing slashes, removing unnecessary escapes, removing default ports, and setting the URL to lowercase.

func PadRows

func PadRows(rows [][]string) (string, error)

PadRows takes a string matrix and returns a string representation of a properly-aligned table.

func QuoteNonASCII

func QuoteNonASCII(s string) string

QuoteNonASCII puts quotes around an identifier that contains non-ASCII characters.

Types

type FormattedRow added in v0.9.1

type FormattedRow struct {
	Content string
	Color   *color.Color
}

FormattedRow represents a formatted table row.

func Table added in v0.9.1

func Table(headers Row, body []Row) ([]FormattedRow, error)

Table outputs a properly-aligned table.

type Row added in v0.9.1

type Row struct {
	Content []string
	Color   *color.Color
}

Row represents a table row.

Jump to

Keyboard shortcuts

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