toolshonnef.co/go/tools/functions Index | Files

package functions

import "honnef.co/go/tools/functions"

Index

Functions

func IsStub

func IsStub(fn *ssa.Function) bool

IsStub reports whether a function is a stub. A function is considered a stub if it has no instructions or exactly one instruction, which must be either returning only constant values or a panic.

func Terminates

func Terminates(fn *ssa.Function) bool

Terminates reports whether fn is supposed to return, that is if it has at least one theoretic path that returns from the function. Explicit panics do not count as terminating.

Types

type Loop

type Loop struct{ ssa.BlockSet }

func FindLoops

func FindLoops(fn *ssa.Function) []Loop

Source Files

loops.go pure.go terminates.go

Version
v0.0.1-2019.2.2
Published
Jul 29, 2019
Platform
js/wasm
Imports
1 packages
Last checked
40 seconds ago

Tools for package owners.