Skip to content

Commit 00f95ce

Browse files
committed
cmd/gofmt: using reflect.TypeAssert
Change-Id: Ic461ba196480d94758d275e96a53e3fc1f6c9a3d
1 parent bd88540 commit 00f95ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/gofmt/rewrite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
165165
name := pattern.Interface().(*ast.Ident).Name
166166
if isWildcard(name) && val.IsValid() {
167167
// wildcards only match valid (non-nil) expressions.
168-
if _, ok := val.Interface().(ast.Expr); ok && !val.IsNil() {
168+
if _, ok := reflect.TypeAssert[ast.Expr](val); ok && !val.IsNil() {
169169
if old, ok := m[name]; ok {
170170
return match(nil, old, val)
171171
}

0 commit comments

Comments
 (0)