astutil

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// BigInt - bound type - bigint
	BigInt = spec.BigInt
	// BigRat - bound type - bigrat
	BigRat = spec.BigRat
	// BigFloat - bound type - bigfloat
	BigFloat = spec.BigFloat
	// ConstBoundRune - bound type: rune
	ConstBoundRune = spec.ConstBoundRune
	// ConstBoundString - bound type: string
	ConstBoundString = spec.ConstBoundString
	// ConstUnboundInt - unbound int type
	ConstUnboundInt = spec.ConstUnboundInt
	// ConstUnboundFloat - unbound float type
	ConstUnboundFloat = spec.ConstUnboundFloat
	// ConstUnboundComplex - unbound complex type
	ConstUnboundComplex = spec.ConstUnboundComplex
	// ConstUnboundPtr - nil: unbound ptr
	ConstUnboundPtr = spec.ConstUnboundPtr
)

Variables

This section is empty.

Functions

func ArrayType

func ArrayType(typ reflect.Type) *ast.ArrayType

ArrayType instr

func ChanType

func ChanType(typ reflect.Type) *ast.ChanType

ChanType instr

func Field

func Field(name string, typ reflect.Type, tag string, ellipsis bool) *ast.Field

Field instr

func FuncType

func FuncType(typ reflect.Type) *ast.FuncType

FuncType instr

func Ident

func Ident(name string) *ast.Ident

Ident - ast.Ident

func IntConst

func IntConst(v int64) *ast.BasicLit

IntConst - ast.BasicLit

func InterfaceType

func InterfaceType(typ reflect.Type) *ast.InterfaceType

InterfaceType instr

func IsConstBound

func IsConstBound(kind ConstKind) bool

IsConstBound checks a const is bound or not.

func MapType

func MapType(typ reflect.Type) *ast.MapType

MapType instr

func Methods

func Methods(typ reflect.Type) []*ast.Field

Methods instr

func PtrType

func PtrType(typElem reflect.Type) ast.Expr

PtrType instr

func StringConst

func StringConst(v string) *ast.BasicLit

StringConst - ast.BasicLit

func StructType

func StructType(typ reflect.Type) ast.Expr

StructType instr

func ToString

func ToString(l *ast.BasicLit) string

ToString converts a ast.BasicLit to string value.

func Type

func Type(typ reflect.Type) ast.Expr

Type instr

Types

type ConstKind

type ConstKind = spec.ConstKind

A ConstKind represents the specific kind of type that a Type represents. The zero Kind is not a valid kind.

func ToConst

func ToConst(v *ast.BasicLit) (ConstKind, interface{})

ToConst converts a ast.BasicLit to constant value.

type RecvInfo

type RecvInfo struct {
	Name    string
	Type    string
	Pointer int
}

RecvInfo represents recv information of a method.

func ToRecv

func ToRecv(recv *ast.FieldList) (ret RecvInfo)

ToRecv converts a ast.FieldList to recv information.

Jump to

Keyboard shortcuts

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