mirror of
				https://github.com/3ybactuk/marketplace-go-service-project.git
				synced 2025-10-31 06:23:44 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			256 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			256 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package model
 | |
| 
 | |
| import "fmt"
 | |
| 
 | |
| type Item struct {
 | |
| 	Product *Product
 | |
| 	Count   uint32 `validate:"gt=0"`
 | |
| }
 | |
| 
 | |
| func (i *Item) Validate() error {
 | |
| 	if err := validate.Struct(i); err != nil {
 | |
| 		return fmt.Errorf("invalid requested values: %w", err)
 | |
| 	}
 | |
| 
 | |
| 	return nil
 | |
| }
 | 
