embeddirective

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

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