Skip to content

Analyzer: unrecover finds a calling function in other goroutine which does not recover any panic

License

Notifications You must be signed in to change notification settings

gostaticanalysis/unrecover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unrecover

pkg.go.dev

unrecover finds a calling function in other goroutine which does not recover any panic.

func f() {
	go func() { // want "this goroutine does not recover a panic"
	}()

	go func() { // OK
		defer func() { recover() }()
	}()

	go func() { // want "this goroutine does not recover a panic"
		recover()
	}()
}

Install

You can get unrecover by go install command (Go 1.16 and higher).

$ go install github.com/gostaticanalysis/unrecover/cmd/unrecover@latest

How to use

unrecover run with go vet as below when Go is 1.12 and higher.

$ go vet -vettool=$(which unrecover) ./...

Analyze with golang.org/x/tools/go/analysis

You can use unrecover.Analyzer with unitchecker.

About

Analyzer: unrecover finds a calling function in other goroutine which does not recover any panic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages