CodeQL library for Go
codeql/go-all 2.1.3-dev (changelog, source)
Search

Class StructType

A struct type.

Import path

import semmle.go.Types

Direct supertypes

Indirect supertypes

Predicates

getField

Gets the field f of this type.

getFieldAtDepth

Gets the field f with depth depth of this type.

getFieldOfEmbedded

Gets a field of embeddedParent, which is then embedded into this struct type.

getMethodAtDepth
getMethodOfEmbedded

Gets a method of embeddedParent, which is then embedded into this struct type.

getOwnField

Get a field with the name name; isEmbedded is true if the field is embedded.

hasField

Holds if this struct contains a field name with type tp, possibly inside a (nested) embedded field.

hasMethod

Holds if the method set of this type contains a method named m of type t.

hasOwnField

Holds if this struct contains a field name with type tp; isEmbedded is true if the field is embedded.

hasOwnFieldWithTag

Holds if this struct contains a field name with type tp and tag tag; isEmbedded is true if the field is embedded.

pp

Gets a pretty-printed representation of this type, including its structure where applicable.

toString

Gets a basic textual representation of this type.

Inherited predicates

getEntity

Gets the entity associated with this type.

from Type
getMethod

Gets the method m belonging to the method set of this type, if any.

from Type
getName

Gets the name of this type, if it has one.

from Type
getPackage

Gets the package in which this type is declared, if any.

from Type
getPointerType

Gets the pointer type that has this type as its base type.

from Type
getQualifiedName

Gets the qualified name of this type, if any.

from Type
getUnderlyingType

Gets the underlying type of this type after any type aliases have been replaced with their definition.

from Type
hasLocationInfo

Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

from Type
hasQualifiedName

Holds if this type is declared in a package with path pkg and has name name.

from Type
implements

Holds if this type implements interface i, that is, the method set of i is contained in the method set of this type and any type restrictions are satisfied.

from Type
implements

Holds if this type implements an interface that has the qualified name pkg.name, that is, the method set of pkg.name is contained in the method set of this type and any type restrictions are satisfied.

from Type
implementsComparable

Holds if this type implements comparable. This includes being comparable itself, or the underlying type of comparable.

from Type