convert

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 6 Imported by: 4

README

go-convert

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.8

func Bool(v any) bool

Bool cast v to bool and return default value if error.

func BoolE added in v0.0.8

func BoolE(input any) (out bool, err error)

BoolE cast input to bool

func Date

func Date(v any) types.Date

Date cast input to types.Date and return default value if error.

func DateE

func DateE(v any) (d types.Date, err error)

DateE cast input to types.Date and return the associated error.

func DateTime

func DateTime(v any) types.DateTime

DateTime cast input to types.DateTime and return default value if error.

func DateTimeE

func DateTimeE(v any) (dt types.DateTime, err error)

DateTimeE cast input to types.DateTime and return the associated error.

func DateYearMonth

func DateYearMonth(v any) types.DateYearMonth

DateYearMonth cast input to types.DateYearMonth and return default value if error.

func DateYearMonthE

func DateYearMonthE(v any) (d types.DateYearMonth, err error)

DateYearMonthE cast input to types.DateYearMonth and return the associated error.

func Float64

func Float64(v any) float64

Float64 cast v to float64 and return default value if there is any error.

func Float64E

func Float64E(v any) (o float64, err error)

Float64E casts input to float64

func Int

func Int(i any) int

Int cast i to int and return default value if error.

func IntE

func IntE(input any) (output int, err error)

IntE cast input to int

func SnakeCase

func SnakeCase(in string) string

SnakeCase

func SnakeCaseWith added in v0.1.0

func SnakeCaseWith(in string, sep rune) string

SnakeCaseWith

func String

func String(input any) string

String cast input to string and return default value if error

func StringE

func StringE(input any) (output string, err error)

StringE cast input to string

func Time

func Time(v any) time.Time

Time cast input to time.Time and return default value if error.

func TimeE

func TimeE(v any) (t time.Time, err error)

TimeE cast input to time.Time and return the associated error.

func Uint

func Uint(v any) uint

Uint cast v to uint64 and return default value if there is any error.

func Uint64

func Uint64(v any) uint64

Uint64 cast v to uint64 and return default value if there is any error.

func Uint64E

func Uint64E(v any) (o uint64, err error)

Uint64E Cast input to uint64

func UintE

func UintE(v any) (o uint, err error)

Uint64E Cast input to uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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