Documentation ¶
Overview ¶
Package whparse provides some convenient input parsing helpers.
Index ¶
- func OptBool(val string, def bool) bool
- func OptFloat32(val string, def float32) float32
- func OptFloat64(val string, def float64) float64
- func OptInt(val string, def int) int
- func OptInt32(val string, def int32) int32
- func OptInt64(val string, def int64) int64
- func OptUint(val string, def uint) uint
- func OptUint32(val string, def uint32) uint32
- func OptUint64(val string, def uint64) uint64
- func ParseBool(val string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptBool ¶
OptBool parses val and returns the bool value in question, unless parsing fails, in which case the default def is returned.
func OptFloat32 ¶
OptFloat32 parses val and returns the float value in question, unless parsing fails, in which case the default def is returned.
func OptFloat64 ¶
OptFloat64 parses val and returns the float value in question, unless parsing fails, in which case the default def is returned.
func OptInt ¶
OptInt parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.
func OptInt32 ¶
OptInt32 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.
func OptInt64 ¶
OptInt64 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.
func OptUint ¶
OptUint parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.
func OptUint32 ¶
OptUint32 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.
Types ¶
This section is empty.