usesgenerics
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package usesgenerics defines an Analyzer that checks for usage of genericfeatures added in Go 1.18.
Analyzer usesgenerics¶
usesgenerics: detect whether a package uses generics features
The usesgenerics analysis reports whether a package directly or transitivelyuses certain features associated with generic programming in Go.
Index¶
Constants¶
const (GenericTypeDecls =genericfeatures.GenericTypeDeclsGenericFuncDecls =genericfeatures.GenericFuncDeclsEmbeddedTypeSets =genericfeatures.EmbeddedTypeSetsTypeInstantiation =genericfeatures.TypeInstantiationFuncInstantiation =genericfeatures.FuncInstantiation)
Variables¶
var Analyzer = &analysis.Analyzer{Name: "usesgenerics",Doc:analysisutil.MustExtractDoc(doc, "usesgenerics"),URL: "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/usesgenerics",Requires: []*analysis.Analyzer{inspect.Analyzer},Run: run,ResultType:reflect.TypeOf((*Result)(nil)),FactTypes: []analysis.Fact{new(featuresFact)},}
Functions¶
This section is empty.
Types¶
typeFeatures¶
type Features =genericfeatures.Features
typeResult¶
type Result struct {Direct, TransitiveFeatures}
Result is the usesgenerics analyzer result type. The Direct field recordsfeatures used directly by the package being analyzed (i.e. contained in thepackage source code). The Transitive field records any features used by thepackage or any of its transitive imports.