comment

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDirective

func HasDirective(comments []*ast.CommentGroup, expected Directive) bool

HasDirective parses a directive from a given list of comments. If no directive is found, the second return value is `false`.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (*Cache) Get

func (c *Cache) Get(fset *token.FileSet, f *ast.File) ast.CommentMap

Get returns a comment map for a given file. In case if a comment map is not found, it creates a new one.

type Directive

type Directive string
const (
	DirectiveIgnore  Directive = prefix + `ignore`
	DirectiveEnforce Directive = prefix + `enforce`
)

Jump to

Keyboard shortcuts

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