pkgfact

package
v0.0.0-...-92d297d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

The pkgfact package is a demonstration and test of the package fact mechanism.

The output of the pkgfact analysis is a set of key/values pairs gathered from the analyzed package and its imported dependencies. Each key/value pair comes from a top-level constant declaration whose name starts and ends with "_". For example:

package p

const _greeting_  = "hello"
const _audience_  = "world"

the pkgfact analysis output for package p would be:

{"greeting": "hello", "audience": "world"}.

In addition, the analysis reports a diagnostic at each import showing which key/value pairs it contributes.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:       "pkgfact",
	Doc:        "gather name/value pairs from constant declarations",
	URL:        "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/pkgfact",
	Run:        run,
	FactTypes:  []analysis.Fact{new(pairsFact)},
	ResultType: reflect.TypeOf(map[string]string{}),
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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