You've already forked go-sqlmock
							
							
				mirror of
				https://github.com/DATA-DOG/go-sqlmock.git
				synced 2025-10-30 23:47:46 +02:00 
			
		
		
		
	Update query.go
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							30283daf08
						
					
				
				
					commit
					faba995e99
				
			
							
								
								
									
										9
									
								
								query.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								query.go
									
									
									
									
									
								
							| @@ -42,13 +42,12 @@ func (f QueryMatcherFunc) Match(expectedSQL, actualSQL string) error { | ||||
| // QueryMatcherRegexp is the default SQL query matcher | ||||
| // used by sqlmock. It parses expectedSQL to a regular | ||||
| // expression and attempts to match actualSQL. | ||||
| var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc(func(expectedSQL, actualSQL string) error { | ||||
| 	if actual != "" and expect == "" { | ||||
| 		return fmt.Errorf("expectedSQL can't be empty") | ||||
| 	} | ||||
| 	 | ||||
| var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc(func(expectedSQL, actualSQL string) error {	 | ||||
| 	expect := stripQuery(expectedSQL) | ||||
| 	actual := stripQuery(actualSQL) | ||||
| 	if actual != "" && expect == "" { | ||||
| 		return fmt.Errorf("expectedSQL can't be empty") | ||||
| 	} | ||||
| 	re, err := regexp.Compile(expect) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user