Documentation ¶
Overview ¶
Package embeddirective defines an Analyzer that validates //go:embed directives. The analyzer defers fixes to its parent golang.Analyzer.
Analyzer embed ¶
embed: check //go:embed directive usage
This analyzer checks that the embed package is imported if //go:embed directives are present, providing a suggested fix to add the import if it is missing.
This analyzer also checks that //go:embed directives precede the declaration of a single variable.
Index ¶
Constants ¶
View Source
const FixCategory = "addembedimport" // recognized by gopls ApplyFix
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "embed", Doc: analysisinternal.MustExtractDoc(doc, "embed"), Run: run, RunDespiteErrors: true, URL: "https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/embeddirective", }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.