nilref

package module
v0.0.0-...-5b758ae Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

Report uses of variables that are nil

When code has already dealt with a variable being nil, it doesn't usually make sense to continue referencing that variable. e.g.

func foo() error {
  result, err := DoSomething()
  if err != nil {
    return err
  }
  if result.IsBad() {
    return err
  }
  return nil
}

Usage

go get github.com/devnev/go-lint-ref-after-nil-check
go-lint-ref-after-nil-check source_file.go source_dir

Status

This has not been tested on a real codebase yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(f *ast.File) []*ast.Ident

func Fix

func Fix(failures []*ast.Ident)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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