scan

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSequence = fmt.Errorf("Invalid sequence")
	ErrInvalidEscape   = fmt.Errorf("Unsupported escape sequence")
)

Functions

func Escape

func Escape(s string, q, x rune) string

Escape escapable chars in a string

func Ident

func Ident(p string) (string, string, error)

Scan an identifier. Identifiers have the form: (<letter>|'_')(<letter>|'_'|<digit>)*

func Join

func Join(a []string, d, e rune) string

Join elements with the provided delimiter, escaping that delimiter when it occurs in an input component.

func Split

func Split(s string, d, e rune) (string, string, error)

Split a string using a delimiter, which may be esacaped by an escape character. When escaped, it is treated as a literal instead of a delimiter. The input string up to the the first delimiter and everything after the first delimiter is returned. If there are no delimiters in the string the entire input string is the first return value. If the input string is empty or only contains a single delimiter, both return values will be empty strings.

func String

func String(p string, q, x rune) (string, string, error)

Scan a parameter string

func White

func White(s string) (string, string)

Skip past leading whitespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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