mirror of
				https://github.com/mgechev/revive.git
				synced 2025-10-30 23:37:49 +02:00 
			
		
		
		
	fix: rule struct-tag false positive on validate:omitempty (#1525)
				
					
				
			This commit is contained in:
		| @@ -843,6 +843,7 @@ var validateSingleOptions = map[string]struct{}{ | ||||
| 	"multibyte":                     {}, | ||||
| 	"number":                        {}, | ||||
| 	"numeric":                       {}, | ||||
| 	"omitempty":                     {}, | ||||
| 	"port":                          {}, | ||||
| 	"postcode_iso3166_alpha2":       {}, | ||||
| 	"postcode_iso3166_alpha2_field": {}, | ||||
|   | ||||
							
								
								
									
										1
									
								
								testdata/struct_tag.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								testdata/struct_tag.go
									
									
									
									
										vendored
									
									
								
							| @@ -156,6 +156,7 @@ type MapStruct struct { | ||||
| } | ||||
|  | ||||
| type ValidateUser struct { | ||||
| 	Id          string `validate:"omitempty,min=3,max=32"` | ||||
| 	Username    string `validate:"required,min=3,max=32"` | ||||
| 	Email       string `validate:"required,email"` | ||||
| 	Password    string `validate:"required,min=8,max=32"` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user