gotype

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 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
 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 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

This section is empty.

Jump to

Keyboard shortcuts

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