 ac77eaac68
			
		
	
	
		ac77eaac68
		
	
	
	
	
		
			
			ed64e33c8c8bc9a919e2b85a1a08225b5ae59d70. Also add tests for local mode of goimports and do refactoring of tests.
		
			
				
	
	
		
			18 lines
		
	
	
		
			330 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			330 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| //args: -Escopelint
 | |
| package testdata
 | |
| 
 | |
| import "fmt"
 | |
| 
 | |
| func ScopelintTest() {
 | |
| 	values := []string{"a", "b", "c"}
 | |
| 	var funcs []func()
 | |
| 	for _, val := range values {
 | |
| 		funcs = append(funcs, func() {
 | |
| 			fmt.Println(val) // ERROR "Using the variable on range scope `val` in function literal"
 | |
| 		})
 | |
| 	}
 | |
| 	for _, f := range funcs {
 | |
| 		f()
 | |
| 	}
 | |
| }
 |