]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/fix: fix cast check
authorKeith Randall <khr@golang.org>
Fri, 9 Feb 2018 19:21:37 +0000 (11:21 -0800)
committerKeith Randall <khr@golang.org>
Fri, 9 Feb 2018 19:47:55 +0000 (19:47 +0000)
Need 2-result cast so we can check the result correctly.

Fixes #23762

Change-Id: Icac3a5415156fe918988f369d6022a9a29c14089
Reviewed-on: https://go-review.googlesource.com/93078
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/fix/cftype.go

index df1cc18f9ead3a098c76979942040744f7d1d9cd..b47b06682add8040c98fa9480e73bf3788d6e062 100644 (file)
@@ -119,7 +119,7 @@ func typefix(f *ast.File, badType func(string) bool) bool {
                if !ok {
                        return
                }
-               t := s.X.(*ast.SelectorExpr)
+               t, ok := s.X.(*ast.SelectorExpr)
                if !ok {
                        return
                }