unused

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package unused contains code for finding unused code.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &lint.Analyzer{
	Doc: &lint.Documentation{
		Title: "Unused code",
	},
	Analyzer: &analysis.Analyzer{
		Name:       "U1000",
		Doc:        "Unused code",
		Run:        run,
		Requires:   []*analysis.Analyzer{buildir.Analyzer, generated.Analyzer, directives.Analyzer},
		ResultType: reflect.TypeOf(Result{}),
	},
}
View Source
var Debug io.Writer

Functions

This section is empty.

Types

type Result

type Result struct {
	Used   []types.Object
	Unused []types.Object
}

TODO(dh): should we return a map instead of two slices?

type SerializedObject

type SerializedObject struct {
	Name            string
	Position        token.Position
	DisplayPosition token.Position
	Kind            string
	InGenerated     bool
}

type SerializedResult

type SerializedResult struct {
	Used   []SerializedObject
	Unused []SerializedObject
}

func Serialize

func Serialize(pass *analysis.Pass, res Result, fset *token.FileSet) SerializedResult

Jump to

Keyboard shortcuts

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