visited

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Visited

type Visited map[visitedKey]bool

Visited allows to remember couples of same type pointers, typically to not do the same action twice if the couple has already been seen.

func NewVisited

func NewVisited() Visited

NewVisited returns a new Visited instance.

func (Visited) Record

func (v Visited) Record(got, expected reflect.Value) bool

Record checks and, if needed, records a new entry for (got, expected) couple. It returns true if got & expected are pointers and have already been seen together. It returns false otherwise. It is the caller responsibility to check that got and expected types are the same.

Jump to

Keyboard shortcuts

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