gotools/cmd/deadcode/deadcode.go

var doc

var testFlag

var tagsFlag

var filterFlag

var generatedFlag

var whyLiveFlag

var formatFlag

var jsonFlag

var cpuProfile

var memProfile

func usage() {}

func main() {}

// prettyName is a fork of Function.String designed to reduce
// go/ssa's fussy punctuation symbols, e.g. "(*pkg.T).F" -> "pkg.T.F".
//
// It only works for functions that remain after
// callgraph.Graph.DeleteSyntheticNodes: source-level named functions
// and methods, their anonymous functions, and synthetic package
// initializers.
func prettyName(fn *ssa.Function, qualified bool) string {}

// printObjects formats an array of objects, either as JSON or using a
// template, following the manner of 'go list (-json|-f=template)'.
func printObjects(format string, objects []any) {}

// isGenerated reports whether the file was generated by a program,
// not handwritten, by detecting the special comment described
// at https://go.dev/s/generatedcode.
//
// The syntax tree must have been parsed with the ParseComments flag.
// Example:
//
//	f, err := parser.ParseFile(fset, filename, src, parser.ParseComments|parser.PackageClauseOnly)
//	if err != nil { ... }
//	gen := ast.IsGenerated(f)
func isGenerated(file *ast.File) bool {}

func generator(file *ast.File) (string, bool) {}

// pathSearch returns the shortest path from one of the roots to one
// of the targets (along with the root itself), or zero if no path was found.
func pathSearch(roots []*ssa.Function, res *rta.Result, targets map[*ssa.Function]bool) (*callgraph.Node, []*callgraph.Edge) {}

func isStaticCall(edge *callgraph.Edge) bool {}

var (
	cwd
	_
)

func toJSONPosition(posn token.Position) jsonPosition {}

func cond[T any](cond bool, t, f T) T {}

type jsonFunction

func (f jsonFunction) String() string {}

type jsonPackage

func (p jsonPackage) String() string {}

type jsonEdge

type jsonPosition

func (p jsonPosition) String() string {}

func containsFunc[S ~[]E, E any](s S, f func(E) bool) bool {}

func indexFunc[S ~[]E, E any](s S, f func(E) bool) int {}

func index[S ~[]E, E comparable](s S, v E) int {}

func reverse[S ~[]E, E any](s S) {}

func keys[M ~map[K]V, K comparable, V any](m M) []K {}