mirror of
				https://github.com/mgechev/revive.git
				synced 2025-10-30 23:37:49 +02:00 
			
		
		
		
	fix: change "GO" to "Go" in the use-any rule (#1077)
This commit is contained in:
		| @@ -47,7 +47,7 @@ func (w lintUseAny) Visit(n ast.Node) ast.Visitor { | ||||
| 		Node:       n, | ||||
| 		Confidence: 1, | ||||
| 		Category:   "naming", | ||||
| 		Failure:    "since GO 1.18 'interface{}' can be replaced by 'any'", | ||||
| 		Failure:    "since Go 1.18 'interface{}' can be replaced by 'any'", | ||||
| 	}) | ||||
|  | ||||
| 	return w | ||||
|   | ||||
							
								
								
									
										20
									
								
								testdata/use-any.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								testdata/use-any.go
									
									
									
									
										vendored
									
									
								
							| @@ -1,19 +1,19 @@ | ||||
| package pkg | ||||
|  | ||||
| var i interface{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| var i interface{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
|  | ||||
| type t interface{}   // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| type a = interface{} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| type t interface{}   // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| type a = interface{} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
|  | ||||
| func any1(a interface{}) { // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m1 := map[interface{}]string{}     // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m2 := map[int]interface{}{}        // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	a := []interface{}{}               // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m3 := make(map[int]interface{}, 1) // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	a2 := make([]interface{}, 2)       // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| func any1(a interface{}) { // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m1 := map[interface{}]string{}     // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m2 := map[int]interface{}{}        // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	a := []interface{}{}               // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	m3 := make(map[int]interface{}, 1) // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| 	a2 := make([]interface{}, 2)       // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
| } | ||||
|  | ||||
| func any2(a int) interface{} {} // MATCH /since GO 1.18 'interface{}' can be replaced by 'any'/ | ||||
| func any2(a int) interface{} {} // MATCH /since Go 1.18 'interface{}' can be replaced by 'any'/ | ||||
|  | ||||
| var ni interface{ Close() } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user