Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analysis = &analysis.Analyzer{ Name: "nilness", Doc: "Annotates return values that will never be nil (typed or untyped)", Run: run, Requires: []*analysis.Analyzer{buildir.Analyzer}, FactTypes: []analysis.Fact{(*neverReturnsNilFact)(nil)}, ResultType: reflect.TypeOf((*Result)(nil)), }
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) MayReturnNil ¶
MayReturnNil reports whether the ret's return value of fn might be a typed or untyped nil value. The value of ret is zero-based. When globalOnly is true, the only possible nil values are global variables.
The analysis has false positives: MayReturnNil can incorrectly report true, but never incorrectly reports false.
Click to show internal directories.
Click to hide internal directories.