Skip to content

kimuson13/errscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

errscope Go Reference

errscope finds code which can narrow the scope of error type.

func f() error {
  return errors.New("this is example")
}

func main() {
  err := f() // it can narrow the scope of error
  if err != nil {
    // error handling
  }
}

If you write code like below, errscope does not point out.

func main() {
  if err := f(); err != nil { // it is ok
    // error handling
  }
}

usage

$ go install gihtub.com/kimuson13/errscope/cmd/errscope@latest
$ errscope ./...

implement soon...

I want to implement the function that can ignore some result. For example

func main() {
  err := f() // ignore 
  if err != nil {
    // error handling
  }
}

This example code can narrow the scope of error type.
But corresponding line has comment such as "// ignore".
I expected that this line don't report by errscope.

About

Tool: errscope analyze that can narrow the scope of error

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages