@@ -188,24 +188,24 @@ func enabledCategory(filter, category string) bool {
188
188
return exclude
189
189
}
190
190
191
- // noEffects reports whether the expression has no side effects, i.e., it
191
+ // noEffects reports whether the expression has no side effects, i.e., it
192
192
// does not modify the memory state. This function is conservative: it may
193
193
// return false even when the expression has no effect.
194
194
func noEffects (expr ast.Expr ) bool {
195
195
noEffects := true
196
196
ast .Inspect (expr , func (n ast.Node ) bool {
197
- switch v := n .(type ) {
197
+ switch v := n .(type ) {
198
198
case nil , * ast.Ident , * ast.BasicLit , * ast.BinaryExpr , * ast.ParenExpr ,
199
- * ast.SelectorExpr , * ast.IndexExpr , * ast.SliceExpr , * ast.TypeAssertExpr ,
200
- * ast.StarExpr , * ast.CompositeLit , * ast.ArrayType , * ast.StructType ,
201
- * ast.MapType , * ast.InterfaceType , * ast.KeyValueExpr :
199
+ * ast.SelectorExpr , * ast.IndexExpr , * ast.SliceExpr , * ast.TypeAssertExpr ,
200
+ * ast.StarExpr , * ast.CompositeLit , * ast.ArrayType , * ast.StructType ,
201
+ * ast.MapType , * ast.InterfaceType , * ast.KeyValueExpr :
202
+ return true
203
+ case * ast.UnaryExpr :
204
+ if v .Op == token .ARROW {
205
+ noEffects = false
206
+ return false
207
+ }
202
208
return true
203
- case * ast.UnaryExpr :
204
- if v .Op == token .ARROW {
205
- noEffects = false
206
- return false
207
- }
208
- return true
209
209
default :
210
210
noEffects = false
211
211
return false
0 commit comments