Documentation
¶
Index ¶
- Variables
- func AsBool(val interface{}) (bool, bool)
- func AsFloat64(val interface{}) (float64, bool)
- func AsInt64(val interface{}) (int64, bool)
- func AsString(val interface{}) (string, bool)
- func AssertEqual(expected string, actual interface{}) (bool, error)
- func Debug()
- func NoLog()
- func Reset()
- func ResetLog()
- func SetTyped(value string, to interface{}) error
- func ToInterface(value string) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedType indicates that expected type is not // managed by kactus library. ErrUnsupportedType = errors.New("unsupported type") // ErrUnmatchedType indicates that value interface does not // match receptor type. ErrUnmatchedType = errors.New("type did not matched expected") )
Functions ¶
func AsBool ¶
AsBool converts str, bool and int interfaces to boolean. For integer: 1 stands for true && 0 for false.
func AsString ¶
AsString converts any interface that as a string representation to string relying on %v format.
func AssertEqual ¶
AssertEqual ensures actual interfaced value is equal to expected string typed value. Type can be ignored on string assertion only.
func ToInterface ¶
ToInterface converts value to asked type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.