cast

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 3 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBoolE

func ToBoolE(s string) (bool, error)

func ToBoolOrDefault added in v1.0.3

func ToBoolOrDefault(s string, d bool) bool

func ToBoolSliceE

func ToBoolSliceE(s []string) ([]bool, error)

func ToByteSliceE

func ToByteSliceE(s string) ([]byte, error)

func ToByteSliceSliceE

func ToByteSliceSliceE(s []string) ([][]byte, error)

func ToErrorE

func ToErrorE(s string) (error, error)

func ToErrorSliceE

func ToErrorSliceE(s []string) ([]error, error)
Example
got, _ := ToErrorSliceE([]string{"test1", "test2"})
fmt.Println(got)
Output:
[test1 test2]

func ToFloat32E

func ToFloat32E(s string) (float32, error)

func ToFloat32SliceE

func ToFloat32SliceE(s []string) ([]float32, error)

func ToFloat64E

func ToFloat64E(s string) (float64, error)

func ToFloat64SliceE

func ToFloat64SliceE(s []string) ([]float64, error)

func ToInt

func ToInt(s string) int

func ToInt8E

func ToInt8E(s string) (int8, error)

func ToInt8SliceE

func ToInt8SliceE(s []string) ([]int8, error)

func ToInt16E

func ToInt16E(s string) (int16, error)

func ToInt16SliceE

func ToInt16SliceE(s []string) ([]int16, error)

func ToInt32E

func ToInt32E(s string) (int32, error)

func ToInt32SliceE

func ToInt32SliceE(s []string) ([]int32, error)

func ToInt64E

func ToInt64E(s string) (int64, error)

func ToInt64SliceE

func ToInt64SliceE(s []string) ([]int64, error)

func ToIntE

func ToIntE(s string) (int, error)

func ToIntOrDefault added in v1.0.3

func ToIntOrDefault(s string, d int) int

func ToIntSliceE

func ToIntSliceE(s []string) ([]int, error)

func ToInterfaceSliceE

func ToInterfaceSliceE(s []string) ([]interface{}, error)

func ToRuneSliceE

func ToRuneSliceE(s string) ([]rune, error)

func ToRuneSliceSliceE

func ToRuneSliceSliceE(s []string) ([][]rune, error)

func ToUint8E

func ToUint8E(s string) (uint8, error)

func ToUint8SliceE

func ToUint8SliceE(s []string) ([]uint8, error)

func ToUint16E

func ToUint16E(s string) (uint16, error)

func ToUint16SliceE

func ToUint16SliceE(s []string) ([]uint16, error)

func ToUint32E

func ToUint32E(s string) (uint32, error)

func ToUint32SliceE

func ToUint32SliceE(s []string) ([]uint32, error)

func ToUint64E

func ToUint64E(s string) (uint64, error)

func ToUint64SliceE

func ToUint64SliceE(s []string) ([]uint64, error)

func ToUintE

func ToUintE(s string) (uint, error)

func ToUintSliceE

func ToUintSliceE(s []string) ([]uint, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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