18 lines
		
	
	
		
			293 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			293 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package binding
 | |
| 
 | |
| import "net/http"
 | |
| 
 | |
| type queryBinding struct{}
 | |
| 
 | |
| func (queryBinding) Name() string {
 | |
| 	return "query"
 | |
| }
 | |
| 
 | |
| func (queryBinding) Bind(req *http.Request, obj any) error {
 | |
| 	values := req.URL.Query()
 | |
| 	if err := mapForm(obj, values); err != nil {
 | |
| 		return err
 | |
| 	}
 | |
| 	return validate(obj)
 | |
| }
 |