Colin Cross | 7bb052a | 2015-02-03 12:59:37 -0800 | [diff] [blame^] | 1 | //gofmt -r=x+x->2*x |
| 2 | |
| 3 | // Copyright 2011 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | // Rewriting of expressions containing nodes with associated comments to |
| 8 | // expressions without those nodes must also eliminate the associated |
| 9 | // comments. |
| 10 | |
| 11 | package p |
| 12 | |
| 13 | func f(x int) int { |
| 14 | _ = x + x // this comment remains in the rewrite |
| 15 | _ = x /* this comment must not be in the rewrite */ + x |
| 16 | return x /* this comment must not be in the rewrite */ + x |
| 17 | } |