Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Must ¶
Must panics if the error is non-nil. It is intended for use in variable initializations such as f := internal.MustNoErr(os.OpenFile("notes.txt", os.O_RDONLY, 0600))
func MustNoErr ¶
func MustNoErr(err error)
MustNoErr logs the error message and exits, if the error is non-nil. It is intended for use statements that could return an error and continued execution is not meaningful.
func MustOk ¶
MustOk is similar to Must, but for the "comma ok" idiom. It is intended for use in statements like str := internal.MustOk(arg.(string))
func NilToZero ¶
NilToZero returns the zero value of type T, if the argument is nil. Otherwise, it casts the value and returns the value. Note that this function panics if the value cannot be cast to type T.
func Parse ¶
Parse attempts to interpret the string as boolean or integer and returns it. Otherwise, it returns the value itself, regardless of its type.
Types ¶
This section is empty.