usesgenerics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package usesgenerics defines an Analyzer that checks for usage of generic features added in Go 1.18.

Index

Constants

View Source
const (
	GenericTypeDecls  = genericfeatures.GenericTypeDecls
	GenericFuncDecls  = genericfeatures.GenericFuncDecls
	EmbeddedTypeSets  = genericfeatures.EmbeddedTypeSets
	TypeInstantiation = genericfeatures.TypeInstantiation
	FuncInstantiation = genericfeatures.FuncInstantiation
)
View Source
const Doc = `` /* 190-byte string literal not displayed */

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:       "usesgenerics",
	Doc:        Doc,
	Requires:   []*analysis.Analyzer{inspect.Analyzer},
	Run:        run,
	ResultType: reflect.TypeOf((*Result)(nil)),
	FactTypes:  []analysis.Fact{new(featuresFact)},
}

Functions

This section is empty.

Types

type Features

type Features = genericfeatures.Features

type Result

type Result struct {
	Direct, Transitive Features
}

Result is the usesgenerics analyzer result type. The Direct field records features used directly by the package being analyzed (i.e. contained in the package source code). The Transitive field records any features used by the package or any of its transitive imports.

Jump to

Keyboard shortcuts

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