makezero

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Overview

Package makezero provides a linter for appends to slices initialized with non-zero length.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendIssue

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

func (AppendIssue) Details

func (a AppendIssue) Details() string

func (AppendIssue) Pos added in v1.1.1

func (a AppendIssue) Pos() token.Pos

func (AppendIssue) Position

func (a AppendIssue) Position() token.Position

func (AppendIssue) String

func (a AppendIssue) String() string

type Issue

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

type Linter

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

func NewLinter

func NewLinter(initialLengthMustBeZero bool) *Linter

func (Linter) Run

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

type MustHaveNonZeroInitLenIssue

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

func (MustHaveNonZeroInitLenIssue) Details

func (i MustHaveNonZeroInitLenIssue) Details() string

func (MustHaveNonZeroInitLenIssue) Pos added in v1.1.1

func (MustHaveNonZeroInitLenIssue) Position

func (MustHaveNonZeroInitLenIssue) String

Jump to

Keyboard shortcuts

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