fsel

package module
v0.0.0-...-efaf268 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 5 Imported by: 0

README

fsel

Go Reference test

Linter: fsel flags field access with unverified nil errors.

func bad() error {
  s, err := doSomething()
  fmt.Println(s.X) // <- field address without checking nilness of err
  return err
}

func good() error {
  s, err := doSomething()
  if err != nil {
    return err
  }
  fmt.Println(s.X) // ok because err is definitely nil
  return nil
}

func doSomething() (*S, error) {
  return nil, errors.New("error")
}

type S struct {
  X int
}

You can try an example by running make run.example.

How to use

go install github.com/qawatake/fsel/cmd/fsel@latest
fsel ./...

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: name,
	Doc:  doc,
	URL:  url,
	Run:  run,
	Requires: []*analysis.Analyzer{
		buildssa.Analyzer,
	},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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