forbidigo

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 10 Imported by: 12

Documentation

Overview

forbidigo provides a linter for forbidding the use of specific identifiers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPatterns

func DefaultPatterns() []string

Types

type ApplyOptionFunc added in v1.1.0

type ApplyOptionFunc func(c *config) error

func OptionExcludeGodocExamples added in v1.1.0

func OptionExcludeGodocExamples(o bool) ApplyOptionFunc

OptionExcludeGodocExamples don't check inside Godoc examples (see https://blog.golang.org/examples)

func OptionIgnorePermitDirectives added in v1.1.0

func OptionIgnorePermitDirectives(o bool) ApplyOptionFunc

OptionIgnorePermitDirectives don't check for `permit` directives(for example, in favor of `nolint`)

type Issue

type Issue interface {
	Details() string
	Position() token.Position
	String() string
}

type Linter

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

func NewLinter

func NewLinter(patterns []string, options ...Option) (*Linter, error)

func (*Linter) Run

func (l *Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error)

type Option added in v1.1.0

type Option interface {
	// contains filtered or unexported methods
}

type UsedIssue

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

func (UsedIssue) Details

func (a UsedIssue) Details() string

func (UsedIssue) Position

func (a UsedIssue) Position() token.Position

func (UsedIssue) String

func (a UsedIssue) String() string

Jump to

Keyboard shortcuts

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