Class Method
A method, that is, a function with a receiver variable, or a function declared in an interface.
Note that method identity is determined by receiver type identity: if two methods have the same name and their receiver types are identical in the sense of the Go language specification (https://golang.org/ref/spec#Type_identity), then the two methods are identical as well.
Import path
import semmle.go.Scopes
Direct supertypes
Indirect supertypes
Known direct subtypes
Fields
Predicates
getPackage | Gets the package in which this entity is declared, if any. |
getReceiver | Gets the receiver variable of this method. |
getReceiverBaseType | Gets the receiver base type of this method, that is, either the base type of the receiver type if it is a pointer type, or the receiver type itself if it is not a pointer type. |
getReceiverType | Gets the type of the receiver variable of this method. |
hasQualifiedName | Holds if this method has name |
hasQualifiedName | Holds if this method has name |
implements | Holds if this method implements the method |
implements | Holds if this method implements the method that has qualified name |
implementsIncludingInterfaceMethods | Holds if this method implements the method |
isInterfaceMethod | Holds if this method is declared in an interface. |
Inherited predicates
getACall | Gets a call to this function. | from Function |
getAParameter | Gets a parameter of this function. | from Function |
getARead | Gets a data-flow node that reads the value of this entity. | from ValueEntity |
getAReference | Gets a reference to this entity. | from Entity |
getAResult | Gets a result variable of this function. | from Function |
getAWrite | Gets a control-flow node that updates the value of this entity. | from ValueEntity |
getBody | Gets the body of this function, if any. | from Function |
getDeclaration | Gets the declaring identifier for this entity, if any. | from Entity |
getFuncDecl | Gets the declaration of this function, if any. | from Function |
getName | Gets the name of this entity. | from Entity |
getNumParameter | Gets the number of parameters of this function. | from Function |
getNumResult | Gets the number of results of this function. | from Function |
getParameter | Gets the | from Function |
getParameterType | Gets the type of the | from Function |
getQualifiedName | Gets the qualified name of this entity, if any. | from Entity |
getResult | Gets the | from Function |
getResultType | Gets the type of the | from Function |
getScope | Gets the scope in which this entity is declared, if any. | from Entity |
getType | Gets the type of this entity. | from Entity |
hasLocationInfo | Holds if this element is at the specified location. The location spans column | from Entity |
isVariadic | Holds if this function is variadic. | from Function |
mayHaveSideEffects | Holds if this function has no observable side effects. | from Function |
mayPanic | Holds if calling this function may cause a runtime panic. | from Function |
mayReturnNormally | Holds if this function may return without panicking, exiting the process, or looping forever. | from Function |
mustPanic | Holds if calling this function always causes a runtime panic. | from Function |
toString | Gets a textual representation of this entity. | from Entity |