mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Added all required dependencies
This commit is contained in:
		
							
								
								
									
										27
									
								
								vendor/github.com/go-xorm/builder/cond_like.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/go-xorm/builder/cond_like.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| package builder | ||||
|  | ||||
| import "fmt" | ||||
|  | ||||
| type Like [2]string | ||||
|  | ||||
| var _ Cond = Like{"", ""} | ||||
|  | ||||
| func (like Like) WriteTo(w Writer) error { | ||||
| 	if _, err := fmt.Fprintf(w, "%s LIKE ?", like[0]); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	w.Append("%" + like[1] + "%") | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (like Like) And(conds ...Cond) Cond { | ||||
| 	return And(like, And(conds...)) | ||||
| } | ||||
|  | ||||
| func (like Like) Or(conds ...Cond) Cond { | ||||
| 	return Or(like, Or(conds...)) | ||||
| } | ||||
|  | ||||
| func (like Like) IsValid() bool { | ||||
| 	return len(like[0]) > 0 && len(like[1]) > 0 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user