types

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bool            = reflect.TypeOf(false)
	Interface       = reflect.TypeOf((*interface{})(nil)).Elem()
	SliceInterface  = reflect.TypeOf(([]interface{})(nil))
	FmtStringer     = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
	Error           = reflect.TypeOf((*error)(nil)).Elem()
	JsonUnmarshaler = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() //nolint: golint
	Time            = reflect.TypeOf(time.Time{})
	Int             = reflect.TypeOf(int(0))
	Uint8           = reflect.TypeOf(uint8(0))
	Rune            = reflect.TypeOf(rune(0))
	String          = reflect.TypeOf("")
)

Functions

func IsStruct added in v1.8.0

func IsStruct(t reflect.Type) bool

IsStruct returns true if "t" is a struct or a pointer on a struct (whatever the number of chained pointers), false otherwise.

Types

type OperatorNotJSONMarshallableError added in v1.9.2

type OperatorNotJSONMarshallableError string

OperatorNotJSONMarshallableError implements error interface. It is returned by (*td.TestDeep).MarshalJSON() to notice the user an operator cannot be JSON Marshal'led.

func AsOperatorNotJSONMarshallableError added in v1.9.2

func AsOperatorNotJSONMarshallableError(err error) (OperatorNotJSONMarshallableError, bool)

AsOperatorNotJSONMarshallableError checks that err is or contains an OperatorNotJSONMarshallableError and if yes, returns it and true.

func (OperatorNotJSONMarshallableError) Error added in v1.9.2

Error implements error interface.

func (OperatorNotJSONMarshallableError) Operator added in v1.9.2

Operator returns the operator behind this error.

type RawInt

type RawInt int

RawInt implements TestDeepStringer interface.

func (RawInt) String

func (i RawInt) String() string

type RawString

type RawString string

RawString implements TestDeepStringer interface.

func (RawString) String

func (s RawString) String() string

type TestDeepStamp

type TestDeepStamp struct{}

TestDeepStamp is a useful type providing the _TestDeep() method needed to implement TestDeepStringer interface.

type TestDeepStringer

type TestDeepStringer interface {
	String() string
	// contains filtered or unexported methods
}

TestDeepStringer is a TestDeep specific interface for objects which know how to stringify themselves.

Jump to

Keyboard shortcuts

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