genutil

package
v0.0.0-...-2c63f42 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Array     types.Type = (*types.Array)(nil)
	Basic     types.Type = (*types.Basic)(nil)
	Interface types.Type = (*types.Interface)(nil)
	Map       types.Type = (*types.Map)(nil)
	Named     types.Type = (*types.Named)(nil)
	Pointer   types.Type = (*types.Pointer)(nil)
	Slice     types.Type = (*types.Slice)(nil)
	Struct    types.Type = (*types.Struct)(nil)
)

Functions

func CheckType

func CheckType(typ types.Type, typs ...types.Type) (types.Type, error)

func Compatible

func Compatible(typ1, typ2 types.Type) bool

func Convertible

func Convertible(typ1, typ2 types.Type) bool

func EqualTypes

func EqualTypes(typs1, typs2 []types.Type) bool

func ExtractNamed

func ExtractNamed(typ types.Type) *types.Named

func ExtractType

func ExtractType(typ types.Type) (_ []types.Type, inner types.Type)

func ExtractTypeAll

func ExtractTypeAll(typ types.Type) (_ []types.Type, inner types.Type)

func ExtractTypeUnwrapNamed

func ExtractTypeUnwrapNamed(typ types.Type) (typs []types.Type, inner types.Type)

func HasPrefixCamel

func HasPrefixCamel(s string, prefix string) bool

func TrimNamed

func TrimNamed(typs []types.Type) []types.Type

func UnwrapNamed

func UnwrapNamed(typ types.Type) types.Type

Types

type Qualifier

type Qualifier struct{}

func (Qualifier) Qualify

func (q Qualifier) Qualify(pkg *types.Package) string

type StructTag

type StructTag struct {
	Name  string
	Value string
}

func (StructTag) String

func (t StructTag) String() string

type StructTags

type StructTags []StructTag

func MustParseStructTags

func MustParseStructTags(tag string) StructTags

func ParseStructTags

func ParseStructTags(tag string) (StructTags, error)

ParseStructTags returns the full set of fields in a struct tag in the order they appear in the struct tag.

func (StructTags) Get

func (tags StructTags) Get(name string) string

func (StructTags) String

func (tags StructTags) String() string

Jump to

Keyboard shortcuts

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