stdtype

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeOf

func TypeOf(typ any) *abi.Type

Types

type Eface

type Eface struct {
	Type *abi.Type
	Data unsafe.Pointer
}

Eface is the definition for interfaces with no method.

  • interface{}
  • any
  • type Foo interface{}

func EfaceOf

func EfaceOf(ep *any) *Eface

type Iface

type Iface struct {
	Itab *abi.Itab
	Data unsafe.Pointer
}

Iface is the definition for interfaces with methods.

func IfaceOf

func IfaceOf[T any](ip *T) *Iface

NOTE: T MUST be of an interface type.

type TypeAssertionError

type TypeAssertionError struct {
	Interface     *abi.Type
	Concrete      *abi.Type
	Asserted      *abi.Type
	MissingMethod string // one method needed by Interface, missing from Concrete
}

A TypeAssertionError explains a failed type assertion.

func (*TypeAssertionError) WriteErr

func (e *TypeAssertionError) WriteErr(w cerr.Writer) int

WriteErr implements cerr.E

Jump to

Keyboard shortcuts

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