blob: f8cc69fda7767528c56cc43a681043bcc9c372a0 [file] [log] [blame]
Alan Donovanc4e846a2023-12-07 16:58:38 -05001// Copyright 2023 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package embeddirective defines an Analyzer that validates //go:embed directives.
6// The analyzer defers fixes to its parent source.Analyzer.
7//
8// # Analyzer embed
9//
10// embed: check //go:embed directive usage
11//
12// This analyzer checks that the embed package is imported if //go:embed
13// directives are present, providing a suggested fix to add the import if
14// it is missing.
15//
16// This analyzer also checks that //go:embed directives precede the
17// declaration of a single variable.
18package embeddirective