whparse

package
v1.0.0-...-3f30213 Latest Latest
Warning

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

Go to latest
Published: May 30, 2017 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package whparse provides some convenient input parsing helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptBool

func OptBool(val string, def bool) bool

OptBool parses val and returns the bool value in question, unless parsing fails, in which case the default def is returned.

func OptFloat32

func OptFloat32(val string, def float32) float32

OptFloat32 parses val and returns the float value in question, unless parsing fails, in which case the default def is returned.

func OptFloat64

func OptFloat64(val string, def float64) float64

OptFloat64 parses val and returns the float value in question, unless parsing fails, in which case the default def is returned.

func OptInt

func OptInt(val string, def int) int

OptInt parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func OptInt32

func OptInt32(val string, def int32) int32

OptInt32 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func OptInt64

func OptInt64(val string, def int64) int64

OptInt64 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func OptUint

func OptUint(val string, def uint) uint

OptUint parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func OptUint32

func OptUint32(val string, def uint32) uint32

OptUint32 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func OptUint64

func OptUint64(val string, def uint64) uint64

OptUint64 parses val and returns the integer value in question, unless parsing fails, in which case the default def is returned.

func ParseBool

func ParseBool(val string) (bool, error)

ParseBool is like strconv.ParseBool but also understands yes/no

Types

This section is empty.

Jump to

Keyboard shortcuts

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