diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 5507d95..703cc1c 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -125,7 +125,7 @@ const ( ) func (n *nilNil) isDangerNilType(t types.Type) (bool, zeroValue) { - switch v := t.(type) { + switch v := types.Unalias(t).(type) { case *types.Pointer: return n.checkedTypes.Contains(ptrType), zeroValueNil diff --git a/pkg/analyzer/analyzer_test.go b/pkg/analyzer/analyzer_test.go index 71475db..bd34943 100644 --- a/pkg/analyzer/analyzer_test.go +++ b/pkg/analyzer/analyzer_test.go @@ -1,3 +1,5 @@ +//go:debug gotypesalias=1 + package analyzer_test import (