Documentation
¶
Index ¶
- func ToBool(i interface{}) bool
- func ToDuration(i interface{}) time.Duration
- func ToFloat64(i interface{}) float64
- func ToInt(i interface{}) int
- func ToInt64(i interface{}) int64
- func ToMap(in interface{}, tagName ...string) (map[string]interface{}, error)
- func ToString(i interface{}) string
- func ToTime(i interface{}) time.Time
- func ToUint(i interface{}) uint
- func ToUint64(i interface{}) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToBool ¶
func ToBool(i interface{}) bool
ToBool casts a interfacfe to bool. It accepts
true: 1, t, T, TRUE, true, True false: 0, f, F, FALSE, false, False, any other value.
func ToDuration ¶
ToDuration casts a interfacfe to time.Duration.
func ToMap ¶ added in v1.2.1
ToMap casts a struct to map. reference: https://www.sobyte.net/post/2021-06/several-ways-to-convert-struct-to-mapstringinterface/
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.