returncheck

package module
v0.0.0-...-92cdbca Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 85

README

returncheck

This is forked from https://github.com/kkaneda/returncheck to make two main changes:

  1. de-internal implementation 2) remove the hardcoded invocation against the since-renamed cockroachdb package.

These changes were made since CockroachDB's linters are now Go tests, so we're happy to just directly invoke the Go function the main method was wrapping.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(pkgNames []string, targetPkg, targetTypeName string) error

Run loads specified packages and checks if there is any unchecked return of the target type (in the target package).

Example
if err := Run([]string{"testdata/test.go"}, "testdata/test.go", "Error"); err != nil {
	fmt.Printf("failed to run return check: %s\n", err)
	return
}
Output:

testdata/test.go:22:3	g()
testdata/test.go:23:3	h()
testdata/test.go:24:11	x, _ := h()
testdata/test.go:29:6	go g()
testdata/test.go:30:9	defer h()
failed to run return check: found an unchecked return value

Types

This section is empty.

Jump to

Keyboard shortcuts

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