text

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v1.6.0

func Bool(value string) (bool, error)

func BoolP added in v1.6.0

func BoolP(value string) (*bool, error)

func BoolSlice added in v1.6.0

func BoolSlice(val, sep string) ([]bool, error)

BoolSlice converts 'val' where individual booleans are separated by 'sep' into a bool slice.

func Bytes added in v1.6.0

func Bytes(val string) ([]byte, error)

Bytes converts the given string representation of a byte sequence into a slice of bytes A bytes sequence is encoded in URL-safe base64 without padding

func BytesSlice added in v1.6.0

func BytesSlice(val, sep string) ([][]byte, error)
BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe

base64 without padding, are separated by 'sep' into a slice of bytes slices slice.

func Float added in v1.6.0

func Float[T constraints.Float](value string) (T, error)

func Float32 added in v1.6.0

func Float32(val string) (float32, error)

Float32 converts the given string representation of a floating point number into float32.

func Float32P added in v1.6.0

func Float32P(val string) (*float32, error)

func Float32Slice added in v1.6.0

func Float32Slice(val, sep string) ([]float32, error)

Float32Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float32 slice.

func Float64 added in v1.6.0

func Float64(val string) (float64, error)

Float64 converts the given string representation into representation of a floating point number into float64.

func Float64P added in v1.6.0

func Float64P(val string) (*float64, error)

func Float64Slice added in v1.6.0

func Float64Slice(val, sep string) ([]float64, error)

Float64Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float64 slice.

func FloatP added in v1.6.0

func FloatP[T constraints.Float](value string) (*T, error)

func FloatSlice added in v1.6.0

func FloatSlice[T constraints.Float](val, sep string) ([]T, error)

FloatSlice converts 'val' where individual floating point numbers are separated by 'sep' into a float slice.

func FormatAny added in v1.6.0

func FormatAny(t any) string

func FormatFor added in v1.6.0

func FormatFor[T any](t T) string

func FormatInteger added in v1.6.0

func FormatInteger(value any) string

func FormatSigned added in v1.6.0

func FormatSigned[T constraints.Signed](v T) string

func FormatUnsigned added in v1.6.0

func FormatUnsigned[T constraints.Unsigned](v T) string

func Int added in v1.6.0

func Int(val string) (int, error)

func Int16 added in v1.6.0

func Int16(val string) (int16, error)

func Int16P added in v1.6.0

func Int16P(val string) (*int16, error)

func Int16Slice added in v1.6.0

func Int16Slice(val, sep string) ([]int16, error)

Int16Slice converts 'val' where individual integers are separated by 'sep' into a int slice.

func Int32 added in v1.6.0

func Int32(val string) (int32, error)

Int32 converts the given string representation of an integer into int32.

func Int32P added in v1.6.0

func Int32P(val string) (*int32, error)

func Int32Slice added in v1.6.0

func Int32Slice(val, sep string) ([]int32, error)

Int32Slice converts 'val' where individual integers are separated by 'sep' into a int32 slice.

func Int64 added in v1.6.0

func Int64(val string) (int64, error)

Int64 converts the given string representation of an integer into int64.

func Int64P added in v1.6.0

func Int64P(val string) (*int64, error)

func Int64Slice added in v1.6.0

func Int64Slice(val, sep string) ([]int64, error)

Int64Slice converts 'val' where individual integers are separated by 'sep' into a int64 slice.

func Int8 added in v1.6.0

func Int8(val string) (int8, error)

func Int8P added in v1.6.0

func Int8P(val string) (*int8, error)

func Int8Slice added in v1.6.0

func Int8Slice(val, sep string) ([]int8, error)

Int8Slice converts 'val' where individual integers are separated by 'sep' into a int8 slice.

func IntP added in v1.6.0

func IntP(val string) (*int, error)

func IntSlice added in v1.6.0

func IntSlice(val, sep string) ([]int, error)

IntSlice converts 'val' where individual integers are separated by 'sep' into a int slice.

func ParseFor added in v1.6.0

func ParseFor[T any](str string) (T, error)

func ParsePtrFor added in v1.6.0

func ParsePtrFor[T any](str string) (*T, error)

func ParseReflectSet added in v1.6.0

func ParseReflectSet(value reflect.Value, val string, field *reflect.StructField) error

func ParseSetField added in v1.6.0

func ParseSetField(dst any, field, value string) error

func ParseStringsReflectSet added in v1.6.0

func ParseStringsReflectSet(value reflect.Value, vals []string, field *reflect.StructField) error

func ReflectFormat added in v1.6.0

func ReflectFormat(value reflect.Value) string

func Signed added in v1.6.0

func Signed[T constraints.Signed](value string) (T, error)

func SignedP added in v1.6.0

func SignedP[T constraints.Signed](value string) (*T, error)

func SignedSlice added in v1.6.0

func SignedSlice[T constraints.Signed](val, sep string) ([]T, error)

SignedSlice converts 'val' where individual integers are separated by 'sep' into a Signed slice.

func String added in v1.6.0

func String(val string) (string, error)

func StringSlice added in v1.6.0

func StringSlice(val, sep string) ([]string, error)

StringSlice converts 'val' where individual strings are separated by 'sep' into a string slice.

func Uint added in v1.6.0

func Uint(val string) (uint, error)

func Uint16 added in v1.6.0

func Uint16(val string) (uint16, error)

func Uint16P added in v1.6.0

func Uint16P(val string) (*uint16, error)

func Uint16Slice added in v1.6.0

func Uint16Slice(val, sep string) ([]uint16, error)

Uint16Slice converts 'val' where individual integers are separated by 'sep' into a uint slice.

func Uint32 added in v1.6.0

func Uint32(val string) (uint32, error)

Uint32 converts the given string representation of an integer into uint32.

func Uint32P added in v1.6.0

func Uint32P(val string) (*uint32, error)

func Uint32Slice added in v1.6.0

func Uint32Slice(val, sep string) ([]uint32, error)

Uint32Slice converts 'val' where individual integers are separated by 'sep' into a uint32 slice.

func Uint64 added in v1.6.0

func Uint64(val string) (uint64, error)

Uint64 converts the given string representation of an integer into uint64.

func Uint64P added in v1.6.0

func Uint64P(val string) (*uint64, error)

func Uint64Slice added in v1.6.0

func Uint64Slice(val, sep string) ([]uint64, error)

Uint64Slice converts 'val' where individual integers are separated by 'sep' into a uint64 slice.

func Uint8 added in v1.6.0

func Uint8(val string) (uint8, error)

func Uint8P added in v1.6.0

func Uint8P(val string) (*uint8, error)

func Uint8Slice added in v1.6.0

func Uint8Slice(val, sep string) ([]uint8, error)

Uint8Slice converts 'val' where individual integers are separated by 'sep' into a uint8 slice.

func UintP added in v1.6.0

func UintP(val string) (*uint, error)

func UintSlice added in v1.6.0

func UintSlice(val, sep string) ([]uint, error)

UintSlice converts 'val' where individual integers are separated by 'sep' into a uint slice.

func UnSigned added in v1.6.0

func UnSigned[T constraints.Unsigned](value string) (T, error)

func UnSignedP added in v1.6.0

func UnSignedP[T constraints.Unsigned](value string) (*T, error)

func UnsignedSlice added in v1.6.0

func UnsignedSlice[T constraints.Unsigned](val, sep string) ([]T, error)

UnsignedSlice converts 'val' where individual integers are separated by 'sep' into a Unsigned slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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