typedness

package
v0.0.0-...-2c056e7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analysis = &analysis.Analyzer{
	Name:       "typedness",
	Doc:        "Annotates return values that are always typed values",
	Run:        run,
	Requires:   []*analysis.Analyzer{buildir.Analyzer},
	FactTypes:  []analysis.Fact{(*alwaysTypedFact)(nil)},
	ResultType: reflect.TypeOf((*Result)(nil)),
}

Functions

This section is empty.

Types

type Result

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

func (*Result) MustReturnTyped

func (r *Result) MustReturnTyped(fn *types.Func, ret int) bool

MustReturnTyped reports whether the ret's return value of fn must be a typed value, i.e. an interface value containing a concrete type or trivially a concrete type. The value of ret is zero-based.

The analysis has false negatives: MustReturnTyped may incorrectly report false, but never incorrectly reports true.

Jump to

Keyboard shortcuts

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