types

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package types provides example types used in tests.

Index

Constants

View Source
const (
	TCBoolA       bool       = true
	TCBoolB       bool       = true
	TCBoolC       bool       = false
	TCStringA     string     = "abc"
	TCStringB     string     = "abc"
	TCStringC     string     = "cba"
	TCIntA        int        = -123
	TCIntB        int        = -123
	TCIntC        int        = -321
	TCInt8A       int8       = -8
	TCInt8B       int8       = -8
	TCInt8C       int8       = -13
	TCInt16A      int16      = -16
	TCInt16B      int16      = -16
	TCInt16C      int16      = -61
	TCInt32A      int32      = -32
	TCInt32B      int32      = -32
	TCInt32C      int32      = -23
	TCInt64A      int64      = -64
	TCInt64B      int64      = -64
	TCInt64C      int64      = -46
	TCUintA       uint       = 123
	TCUintB       uint       = 123
	TCUintC       uint       = 321
	TCUint8A      uint8      = 8
	TCUint8B      uint8      = 8
	TCUint8C      uint8      = 13
	TCUint16A     uint16     = 16
	TCUint16B     uint16     = 16
	TCUint16C     uint16     = 61
	TCUint32A     uint32     = 32
	TCUint32B     uint32     = 32
	TCUint32C     uint32     = 23
	TCUint64A     uint64     = 64
	TCUint64B     uint64     = 64
	TCUint64C     uint64     = 46
	TCUintptrA    uintptr    = 42
	TCUintptrB    uintptr    = 42
	TCUintptrC    uintptr    = 24
	TCFloat32A    float32    = 32.0
	TCFloat32B    float32    = 32.0
	TCFloat32C    float32    = 23.0
	TCFloat64A    float64    = 64.0
	TCFloat64B    float64    = 64.0
	TCFloat64C    float64    = 46.0
	TCComplex64A  complex64  = 6i + 4
	TCComplex64B  complex64  = 6i + 4
	TCComplex64C  complex64  = 4i + 6
	TCComplex128A complex128 = 12i + 8
	TCComplex128B complex128 = 12i + 8
	TCComplex128C complex128 = 8i + 12

	CBoolA       = true
	CBoolB       = true
	CBoolC       = false
	CStringA     = "abc"
	CStringB     = "abc"
	CStringC     = "xyz"
	CIntA        = 123
	CIntB        = 123
	CIntC        = 321
	CFloatA      = 1.23
	CFloatB      = 1.23
	CFloatC      = 3.21
	CComplex64A  = 6i + 4
	CComplex64B  = 6i + 4
	CComplex64C  = 4i + 6
	CComplex128A = 12i + 8
	CComplex128B = 12i + 8
	CComplex128C = 8i + 12
)

Variables

WAW represents Europe/Warsaw timezone.

Functions

func TFuncA

func TFuncA()

func TFuncB

func TFuncB()

Types

type T1

type T1 struct {
	Int int
	T1  *T1 // Recursive.
}

type TA

type TA struct {
	Int int
	Str string
	Tim time.Time
	Dur time.Duration
	Loc *time.Location
	TAp *TA
	// contains filtered or unexported fields
}

type TB

type TB struct {
	TA     // Embedded by value.
	TAv TA // Non pointer type.
}

type TC

type TC struct {
	TD
	Int int
}

type TD

type TD string

type TInt

type TInt struct{ V int }

func NewTInt

func NewTInt(v int) (*TInt, error)

type TIntPrv

type TIntPrv struct {
	Int int
	// contains filtered or unexported fields
}

func NewTIntPrv

func NewTIntPrv(i, v int) TIntPrv

type TIntStr

type TIntStr struct {
	Int int
	Str string
}

type TIntType

type TIntType int

type TItf

type TItf interface{ AAA() string }

TItf is an interface used in tests.

type TLoc

type TLoc struct{ Loc *time.Location }

type TNested

type TNested struct {
	SInt    []int
	STA     []TA
	STAp    []*TA
	MStrInt map[string]int
	MStrTyp map[string]TA
	MIntTyp map[int]TA
}

type TPtr

type TPtr struct{ Val string } // nolint: errname

func (*TPtr) AAA

func (typ *TPtr) AAA() string

func (*TPtr) Error

func (typ *TPtr) Error() string

func (*TPtr) Identity added in v0.6.0

func (typ *TPtr) Identity(val *string) *string

func (*TPtr) Variadic added in v0.6.0

func (typ *TPtr) Variadic(str string, i ...int) string

func (*TPtr) Wrap added in v0.6.0

func (typ *TPtr) Wrap(a, b string) string

type TStrType

type TStrType string

type TTim

type TTim struct{ Tim time.Time }

type TVal

type TVal struct{ Val string } // nolint: errname

func (TVal) AAA

func (typ TVal) AAA() string

func (TVal) Error

func (typ TVal) Error() string

Jump to

Keyboard shortcuts

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