@@ -131,8 +131,7 @@ func (s *snapshot) actionHandle(ctx context.Context, id packageID, mode source.P
131
131
err : err ,
132
132
}
133
133
}
134
- data := runAnalysis (ctx , fset , a , pkg , results )
135
- return data
134
+ return runAnalysis (ctx , fset , a , pkg , results )
136
135
})
137
136
ah .handle = h
138
137
@@ -145,7 +144,10 @@ func (act *actionHandle) analyze(ctx context.Context) ([]*source.Error, interfac
145
144
if v == nil {
146
145
return nil , nil , errors .Errorf ("no analyses for %s" , act .pkg .ID ())
147
146
}
148
- data := v .(* actionData )
147
+ data , ok := v .(* actionData )
148
+ if ! ok {
149
+ return nil , nil , errors .Errorf ("unexpected type for %s:%s" , act .pkg .ID (), act .analyzer .Name )
150
+ }
149
151
return data .diagnostics , data .result , data .err
150
152
}
151
153
@@ -154,7 +156,10 @@ func (act *actionHandle) cached() ([]*source.Error, interface{}, error) {
154
156
if v == nil {
155
157
return nil , nil , errors .Errorf ("no analyses for %s" , act .pkg .ID ())
156
158
}
157
- data := v .(* actionData )
159
+ data , ok := v .(* actionData )
160
+ if ! ok {
161
+ return nil , nil , errors .Errorf ("unexpected type for %s:%s" , act .pkg .ID (), act .analyzer .Name )
162
+ }
158
163
return data .diagnostics , data .result , data .err
159
164
}
160
165
0 commit comments