Skip to content

Commit 9fedd25

Browse files
committed
fix modernize format
1 parent ca10c13 commit 9fedd25

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

gopls/internal/analysis/modernize/modernize.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,24 @@ func enabledCategory(filter, category string) bool {
188188
return exclude
189189
}
190190

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
192192
// does not modify the memory state. This function is conservative: it may
193193
// return false even when the expression has no effect.
194194
func noEffects(expr ast.Expr) bool {
195195
noEffects := true
196196
ast.Inspect(expr, func(n ast.Node) bool {
197-
switch v := n.(type) {
197+
switch v := n.(type) {
198198
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+
}
202208
return true
203-
case *ast.UnaryExpr:
204-
if v.Op == token.ARROW {
205-
noEffects = false
206-
return false
207-
}
208-
return true
209209
default:
210210
noEffects = false
211211
return false

0 commit comments

Comments
 (0)