Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsZeroSized ¶ added in v0.0.11
IsZeroSized determines whether the type t is provably zero-sized.
Types ¶
type Checker ¶
type Checker struct { // Type definitions excluded via `//nolint:zerolint` directives. ExcludedTypeDefs filter.Filter Excludes set.Set[string] Detected map[string]bool // Filter for zero-sized checks, used in [Checker.ZeroSizedType]. Regex *regexp.Regexp // contains filtered or unexported fields }
Checker provides helper functions for analyzing pointers to zero-sized types.
func (*Checker) Prepare ¶
func (c *Checker) Prepare()
Prepare initializes the Checker with the provided [analysis.Pass], preparing for new analysis.
func (*Checker) ZeroSizedType ¶
ZeroSizedType determines whether t is a zero-sized type, considering exclusions.
It returns:
- zeroSized: true if t is zero-sized (and not excluded).
and, if zeroSized is true:
- valueMethod: the type has value receiver methods.
func (*Checker) ZeroSizedTypePointer ¶
ZeroSizedTypePointer checks whether t is a pointer to a zero-sized type.
It returns:
- zeroSized: true if t is a pointer to a zero-sized type (and not excluded).
and, if zeroSized is true:
- elem: the underlying zero-sized element type of the pointer.
- valueMethod: the element type has value receiver methods.
Click to show internal directories.
Click to hide internal directories.