gotype

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFuncSignature

func FindFuncSignature(p *packages.Package, fnName string) *types.Signature

func FindInterfaceMethodSignature

func FindInterfaceMethodSignature(
	p *packages.Package,
	intfName, methodName string,
) *types.Signature

func GetFuncParamInfosFromSignature

func GetFuncParamInfosFromSignature(fn *types.Signature, mockPkg string) []*gosyntax.FieldDeclInfo

func GetFuncReturnInfosFromSignature

func GetFuncReturnInfosFromSignature(fn *types.Signature, mockPkg string) []*gosyntax.FieldDeclInfo

func RenderTypeDeclString

func RenderTypeDeclString(t types.Type, variadic bool, mockPkg string) string

Types

type FuncTypeSpec added in v0.1.11

type FuncTypeSpec struct {
	Signature  *types.Signature
	FieldInfo  []*gosyntax.FieldDeclInfo
	ReturnInfo []*gosyntax.FieldDeclInfo
}
 Quick reference to GO type objects that are used in this package

	Package {
		Name() string
		Path() string
		Imports() []*Package
		Scope() *Scope
			elems (string -> types.Object)
 }

 types.Object (interface) {
		Pkg() *Package  // package to which this object belongs; nil for labels and objects in the Universe scope
		Name() string   // package local object name
		Type() Type     // object type
		Exported() bool // reports whether the name starts with a capital letter
		Id() string     // object name if exported, qualified name if not exported (see func Id)
		String() string
 }
		PkgName
		TypeName
		Const
		Var
		Func
		Label
		Builtin
		Nil

	types.Type (interface) {
		Underlying() Type
		String() string
 }

		Basic
		Slice
		Array
		Struct
		Interface
		Map
		Chan
		Pointer
		Signature (A Signature represents a (non-builtin) function or method type)
		Tuple
		Named

func GetFuncTypeSpec added in v0.1.11

func GetFuncTypeSpec(pkgPath, funcName string, mockPkgName string) (*FuncTypeSpec, error)

Jump to

Keyboard shortcuts

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