typeutil

package
v0.0.0-...-6d43c30 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package typeutil contains helepr methods for interaction with ast types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInterface

func FindInterface(
	fileSet *token.FileSet,
	packageName string,
	interfaceName string,
) (*structs.Interface, error)

FindInterface finds the given interface name in the given package. Returns nil if no interface is found.

func GetInterfaceMethod

func GetInterfaceMethod(interfaceType *types.Interface, methodName string) *types.Func

GetInterfaceMethod returns the method with given name in the interface, or nil

func HasFieldOfType

func HasFieldOfType(
	targetStruct *types.Struct,
	fieldType reflect.Type,
) bool

HasFieldOfType returns true if the given struct has a non-exported field of type fieldType

func IDFromNamed

func IDFromNamed(name *types.Named) string

IDFromNamed returns a unique string for the given name

Types

This section is empty.

Jump to

Keyboard shortcuts

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