Source file test/fixedbugs/issue81697.go

     1  // run
     2  
     3  // Copyright 2026 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  package main
     8  
     9  func main() {
    10  	var p *[3]int
    11  	for i, _ := range *p {
    12  		_ = i
    13  	}
    14  	for i, _ := range (*p) { // Note the parentheses! gofmt wants to remove them - don't let it!
    15  		_ = i
    16  	}
    17  	var i int
    18  	for i, (_) = range *p { // Note the parentheses! gofmt wants to remove them - don't let it!
    19  		_ = i
    20  	}
    21  }
    22  

View as plain text