We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b2c7e7 commit 57ed899Copy full SHA for 57ed899
rule/unexported_return.go
@@ -16,6 +16,8 @@ type UnexportedReturnRule struct{}
16
func (*UnexportedReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
17
var failures []lint.Failure
18
19
+ file.Pkg.TypeCheck()
20
+
21
for _, decl := range file.AST.Decls {
22
fn, ok := decl.(*ast.FuncDecl)
23
if !ok {
@@ -70,7 +72,7 @@ func (*UnexportedReturnRule) Name() string {
70
72
// It is imprecise, and will err on the side of returning true,
71
73
// such as for composite types.
74
func exportedType(typ types.Type) bool {
- switch t := typ.(type) {
75
+ switch t := types.Unalias(typ).(type) {
76
case *types.Named:
77
obj := t.Obj()
78
switch {
0 commit comments