mirror of
				https://github.com/mgechev/revive.git
				synced 2025-10-30 23:37:49 +02:00 
			
		
		
		
	add test with complex condition
This commit is contained in:
		
							
								
								
									
										6
									
								
								testdata/unnecessary_conditional.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								testdata/unnecessary_conditional.go
									
									
									
									
										vendored
									
									
								
							| @@ -130,6 +130,12 @@ func unnecessaryConditional() bool { | ||||
| 		id = true | ||||
| 	} | ||||
|  | ||||
| 	if (something > 0) && (!id) || (something+10 <= 0) { // MATCH /replace this conditional by: id = !((something > 0) && (!id) || (something+10 <= 0))/ | ||||
| 		id = false | ||||
| 	} else { | ||||
| 		id = true | ||||
| 	} | ||||
|  | ||||
| 	// conditionals with initialization | ||||
| 	if cond := false; cond { | ||||
| 		return true | ||||
|   | ||||
		Reference in New Issue
	
	Block a user