go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
22.38k stars 2.13k forks source link

dwarf/loclist: remove impossible condition #3677

Closed alexandear closed 4 months ago

alexandear commented 4 months ago

The PR removes the redundant err != nil check because err cannot be nil in that context.

This was found by the nilness analyzer:

❯ go install golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest
❯ go vet -vettool=$(which nilness) ./...
# github.com/go-delve/delve/pkg/dwarf/loclist
# [github.com/go-delve/delve/pkg/dwarf/loclist]
pkg/dwarf/loclist/dwarf5_loclist.go:121:10: impossible condition: nil != nil