fieldtrack

package
v0.0.0-...-9e80811 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package fieldtrack provides access to information in the current binary that tracks use of struct fields. This information is computed at build time for struct fields marked with the `go:"track"` tag. See http://go/fieldtrack for background.

To test run:

GOEXPERIMENT=fieldtrack ./make.bash
go test rsc.io/tmp/fieldtrack -ldflags=-k=rsc.io/tmp/fieldtrack.tracked

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether field tracking was enabled in the compiler when compiling the current binary.

func Ref

func Ref(field string) []string

Ref returns the list of references explaining why the given field name is used by the current binary. The field name should be in the form returned by Tracked. The references start at a global symbol and end with the field. If the field is not used by the current binary, Ref returns nil.

func Tracked

func Tracked() []string

Tracked returns a sorted list of all tracked fields used by the current binary. The form of each entry is "full/import/path.TypeName.FieldName".

Types

This section is empty.

Jump to

Keyboard shortcuts

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