Fix time.Time binding (#904)
If a empty string is given(`""`), them time should be zero.
This commit is contained in:
		| @ -153,6 +153,11 @@ func setTimeField(val string, structField reflect.StructField, value reflect.Val | |||||||
| 		return errors.New("Blank time format") | 		return errors.New("Blank time format") | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
|  | 	if val == "" { | ||||||
|  | 		value.Set(reflect.ValueOf(time.Time{})) | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	l := time.Local | 	l := time.Local | ||||||
| 	if isUTC, _ := strconv.ParseBool(structField.Tag.Get("time_utc")); isUTC { | 	if isUTC, _ := strconv.ParseBool(structField.Tag.Get("time_utc")); isUTC { | ||||||
| 		l = time.UTC | 		l = time.UTC | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user