Help us shape the future of Go! Take the 2026 Go Developer Survey

parse

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Complex64

func Complex64(s string) (complex64, error)

Complex64 delegates to strconv.ParseComplex for go >= 1.15.

func Complex128

func Complex128(s string) (complex128, error)

Complex128 delegates to strconv.ParseComplex for go >= 1.15.

func Map

func Map(s string, mapType reflect.Type) (reflect.Value, error)

Map converts a string representation of a map with concrete values as keys and vals into a reflect.Value representing that map.

func String

func String(str string, t reflect.Type) (reflect.Value, error)

String casts the provided string into the provided type, returning the result in a reflect.Value.

func StringSet

func StringSet(s string) (map[string]struct{}, error)

StringSet splits a comma separated string and constructs a map[string]struct{} to represent a set

func StringSlice

func StringSlice(s string) ([]string, error)

StringSlice splits a comma separated string and constructs a slice

func StringStringSliceMap

func StringStringSliceMap(s string) (map[string][]string, error)

StringStringSliceMap takes in a string representation of a map with strings as keys and string slices as values, and converts it to a map[string][]string.

Types

type NumberError

type NumberError struct {
	// contains filtered or unexported fields
}

NumberError represents an error when parsing a string to generate a numeric type.

func (*NumberError) Error

func (e *NumberError) Error() string

func (*NumberError) Unwrap

func (e *NumberError) Unwrap() error

type OverflowError

type OverflowError struct {
	// contains filtered or unexported fields
}

OverflowError represents an overflow when casting to a numeric type.

func (*OverflowError) Error

func (e *OverflowError) Error() string

func (*OverflowError) Unwrap

func (e *OverflowError) Unwrap() error

Jump to

Keyboard shortcuts

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