fieldtest

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fieldtest helps tests check that code handling every field of a struct keeps up with fields added to it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fields

func Fields(t reflect.Type, into ...string) []string

Fields returns the names of the exported fields of the struct type t, with the fields of embedded structs promoted as Go promotes them. The struct pointer fields named in into are replaced by their own fields, as "Target.TargetStr". Fields of the sync packages are left out.

func Fill

func Fill(v any, seed int)

Fill sets every exported field of the struct v points to, and of the structs its pointer fields lead to, to a value that differs from the zero value and from the other fields; structs filled with different seeds differ in every field, and an even seed sets the booleans. Fields of the sync packages are left alone.

func Value

func Value(v reflect.Value, name string) reflect.Value

Value returns the field of the struct v that Fields names name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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