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

reflectlite

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSyntax = &errorString{"invalid syntax"}
)

Functions

func ArrayOf

func ArrayOf(count int, elem Type) Type

func ChanOf

func ChanOf(dir ChanDir, t Type) Type

func Copy

func Copy(dst, src Value) int

func DeepEqual

func DeepEqual(a1, a2 interface{}) bool

func FuncOf

func FuncOf(in, out []Type, variadic bool) Type

func MapOf

func MapOf(key, elem Type) Type

func PtrTo

func PtrTo(t Type) Type

PtrTo returns the pointer type with element t. For example, if t represents type Foo, PtrTo(t) represents *Foo.

func SliceOf

func SliceOf(t Type) Type

func Swapper

func Swapper(slice interface{}) func(i, j int)

func TypeOf

func TypeOf(i interface{}) Type

Types

type ChanDir

type ChanDir int
const (
	RecvDir ChanDir             = 1 << iota // <-chan
	SendDir                                 // chan<-
	BothDir = RecvDir | SendDir             // chan
)

type Method

type Method struct {
	// Name is the method name.
	// PkgPath is the package path that qualifies a lower case (unexported)
	// method name. It is empty for upper case (exported) method names.
	// The combination of PkgPath and Name uniquely identifies a method
	// in a method set.
	// See https://golang.org/ref/spec#Uniqueness_of_identifiers
	Name    string
	PkgPath string

	Type  Type  // method type
	Func  Value // func with receiver as first argument
	Index int   // index for Type.Method
}

Method represents a single method.

type SelectDir

type SelectDir int

A SelectDir describes the communication direction of a select case.

const (
	SelectSend    SelectDir // case Chan <- Send
	SelectRecv              // case <-Chan:
	SelectDefault           // default
)

type StructTag

type StructTag string

A StructTag is the tag string in a struct field.

By convention, tag strings are a concatenation of optionally space-separated key:"value" pairs. Each key is a non-empty string consisting of non-control characters other than space (U+0020 ' '), quote (U+0022 '"'), and colon (U+003A ':'). Each value is quoted using U+0022 '"' characters and Go string literal syntax.

type TypeEx

type TypeEx interface {
	Type
	Key() Type
}

Jump to

Keyboard shortcuts

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