cast

package
v0.0.0-...-3022a63 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStringValue

func GetStringValue(str string) interface{}

GetStringValue converts the given string to either bool, int, float or single quoted string.

func ToIfaceSlice

func ToIfaceSlice(v interface{}) []interface{}

ToIfaceSlice converts an interface to slice of interfaces if it is not nil.

func TryBool

func TryBool(v interface{}) (bool, bool)

TryBool tries to convert the given interface to bool and returns it if it is successful. An additional boolean flag denotes if it was successful or not.

func TryFloat

func TryFloat(v interface{}) (float64, bool)

TryFloat tries to convert the given interface to float64 and returns it if it is successful. An additional boolean flag denotes if it was successful or not.

func TryInt

func TryInt(v interface{}) (int64, bool)

TryInt tries to convert the given interface to int64 and returns it if it is successful. An additional boolean flag denotes if it was successful or not.

func TryString

func TryString(v interface{}) (string, bool)

TryString tries to convert the given interface to string and returns it if it is successful. An additional boolean flag denotes if it was successful or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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