comment

package module
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 3 Imported by: 29

README

gostaticanalysis/comment

godoc.org

comment provides utilities for ast.CommentMap.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Maps

type Maps []ast.CommentMap

Maps is slice of ast.CommentMap.

func New

func New(fset *token.FileSet, files []*ast.File) Maps

New creates new a CommentMap slice from specified files.

func (Maps) Annotated

func (maps Maps) Annotated(n ast.Node, annotation string) bool

Annotated checks either specified AST node is annotated or not.

func (Maps) Comments

func (maps Maps) Comments(n ast.Node) []*ast.CommentGroup

Comments returns correspond a CommentGroup slice to specified AST node.

func (Maps) CommentsByLine deprecated added in v1.3.0

func (maps Maps) CommentsByLine(fset *token.FileSet, line int) []*ast.CommentGroup

Deprecated: This function does not work with multiple files. CommentsByPosLine can be used instead of CommentsByLine.

CommentsByLine returns correspond a CommentGroup slice to specified line.

func (Maps) CommentsByPos added in v1.2.0

func (maps Maps) CommentsByPos(pos token.Pos) []*ast.CommentGroup

CommentsByPos returns correspond a CommentGroup slice to specified pos.

func (Maps) CommentsByPosLine added in v1.4.0

func (maps Maps) CommentsByPosLine(fset *token.FileSet, pos token.Pos) []*ast.CommentGroup

CommentsByPosLine returns correspond a CommentGroup slice to specified line.

func (Maps) Ignore added in v1.1.0

func (maps Maps) Ignore(n ast.Node, check string) bool

Ignore checks either specified AST node is ignored by the check. It follows staticcheck style as the below.

//lint:ignore Check1[,Check2,...,CheckN] reason

func (Maps) IgnoreLine added in v1.3.0

func (maps Maps) IgnoreLine(fset *token.FileSet, line int, check string) bool

IgnoreLine checks either specified lineof AST node is ignored by the check. It follows staticcheck style as the below.

//lint:ignore Check1[,Check2,...,CheckN] reason

func (Maps) IgnorePos added in v1.2.0

func (maps Maps) IgnorePos(pos token.Pos, check string) bool

IgnorePos checks either specified postion of AST node is ignored by the check. It follows staticcheck style as the below.

//lint:ignore Check1[,Check2,...,CheckN] reason

Directories

Path Synopsis
passes

Jump to

Keyboard shortcuts

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