Help us shape the future of Go! Take the 2026 Go Developer Survey

convert

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsBool

func AsBool(s interface{}) (bool, error)

func AsFloat32

func AsFloat32(s interface{}) (float32, error)

func AsFloat64

func AsFloat64(s interface{}) (float64, error)

func AsInt

func AsInt(s interface{}) (int, error)

func AsInt8

func AsInt8(s interface{}) (int8, error)

func AsInt16

func AsInt16(s interface{}) (int16, error)

func AsInt32

func AsInt32(s interface{}) (int32, error)

func AsInt64

func AsInt64(s interface{}) (int64, error)

func AsString

func AsString(s interface{}) (string, error)

func AsUInt

func AsUInt(s interface{}) (uint, error)

func AsUInt8

func AsUInt8(s interface{}) (uint8, error)

func AsUInt16

func AsUInt16(s interface{}) (uint16, error)

func AsUInt32

func AsUInt32(s interface{}) (uint32, error)

func AsUInt64

func AsUInt64(s interface{}) (uint64, error)

func BestEffortBool

func BestEffortBool(s interface{}) bool

func BestEffortFlat32

func BestEffortFlat32(s interface{}) float32

func BestEffortFlat64

func BestEffortFlat64(s interface{}) float64

func BestEffortInt

func BestEffortInt(s interface{}) int

func BestEffortInt8

func BestEffortInt8(s interface{}) int8

func BestEffortInt16

func BestEffortInt16(s interface{}) int16

func BestEffortInt32

func BestEffortInt32(s interface{}) int32

func BestEffortInt64

func BestEffortInt64(s interface{}) int64

func BestEffortString

func BestEffortString(s interface{}) string

func BestEffortUInt

func BestEffortUInt(s interface{}) uint

func BestEffortUInt8

func BestEffortUInt8(s interface{}) uint8

func BestEffortUInt16

func BestEffortUInt16(s interface{}) uint16

func BestEffortUInt32

func BestEffortUInt32(s interface{}) uint32

func BestEffortUInt64

func BestEffortUInt64(s interface{}) uint64

func Bool

func Bool(s interface{}) bool

func BoolType

func BoolType() reflect.Type

func ConvertTo

func ConvertTo(v interface{}, proto interface{}) (interface{}, error)

ConvertTo tries to convert an object to a dedicated type The type may be given by either a pointer to a prototype of the desired type or the final type object. If no pointer type is is desired the prototype might be of the desired type or a pointer to an object of this type Examples:

  • reflect.Type("string") -> string
  • "string" -> string
  • (*string)(nil) -> string
  • (**string)(nil) -> *string

func Float32

func Float32(s interface{}) float32

func Float32Type

func Float32Type() reflect.Type

func Float64

func Float64(s interface{}) float64

func Float64Type

func Float64Type() reflect.Type

func Int

func Int(s interface{}) int

func Int8

func Int8(s interface{}) int8

func Int8Type

func Int8Type() reflect.Type

func Int16

func Int16(s interface{}) int16

func Int16Type

func Int16Type() reflect.Type

func Int32

func Int32(s interface{}) int32

func Int32Type

func Int32Type() reflect.Type

func Int64

func Int64(s interface{}) int64

func Int64Type

func Int64Type() reflect.Type

func IntType

func IntType() reflect.Type

func String

func String(s interface{}) string

func StringType

func StringType() reflect.Type

func UInt

func UInt(s interface{}) uint

func UInt8

func UInt8(s interface{}) uint8

func UInt8Type

func UInt8Type() reflect.Type

func UInt16

func UInt16(s interface{}) uint16

func UInt16Type

func UInt16Type() reflect.Type

func UInt32

func UInt32(s interface{}) uint32

func UInt32Type

func UInt32Type() reflect.Type

func UInt64

func UInt64(s interface{}) uint64

func UInt64Type

func UInt64Type() reflect.Type

func UIntType

func UIntType() reflect.Type

Types

This section is empty.

Jump to

Keyboard shortcuts

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