floatstr

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloatOrString

type FloatOrString struct {
	Type      Type
	FloatVal  float64
	StringVal string
}

func FromFloat

func FromFloat(val float64) *FloatOrString

func FromString

func FromString(val string) *FloatOrString

func Parse

func Parse(val string) *FloatOrString

func (FloatOrString) MarshalJSON

func (fs FloatOrString) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

func (*FloatOrString) String

func (fs *FloatOrString) String() string

String returns the string value, or the float value formatted as a string.

func (*FloatOrString) UnmarshalJSON

func (fs *FloatOrString) UnmarshalJSON(value []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

type Type

type Type int

Type represents the stored type of IntOrBool.

const (
	Float  Type = iota // The FloatOrString holds an Float.
	String             // The FloatOrString holds a string.
)

Jump to

Keyboard shortcuts

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