Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Vidmar committed Oct 23, 2024
1 parent 5e1fab4 commit 6e333c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (col *Collection) GetAll() (*Collection, error) {
return nil, errNext
}
allItems = append(allItems, col.Items...)
if uint16(len(col.Items)) < col.Limit {
if len(col.Items) < int(col.Limit) {
break
}
}
Expand Down
24 changes: 12 additions & 12 deletions content_type_field_validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,24 @@ func (v *FieldValidationDimension) UnmarshalJSON(data []byte) error {
if width, ok := dimensionData["width"].(map[string]interface{}); ok {
v.Width = &MinMax{}

if min, ok := width["min"].(float64); ok {
v.Width.Min = min
if minimum, ok := width["min"].(float64); ok {
v.Width.Min = minimum
}

if max, ok := width["min"].(float64); ok {
v.Width.Max = max
if maximum, ok := width["min"].(float64); ok {
v.Width.Max = maximum
}
}

if height, ok := dimensionData["height"].(map[string]interface{}); ok {
v.Height = &MinMax{}

if min, ok := height["min"].(float64); ok {
v.Height.Min = min
if minimum, ok := height["min"].(float64); ok {
v.Height.Min = minimum
}

if max, ok := height["max"].(float64); ok {
v.Height.Max = max
if maximum, ok := height["max"].(float64); ok {
v.Height.Max = maximum
}
}

Expand Down Expand Up @@ -193,17 +193,17 @@ func (v *FieldValidationDate) UnmarshalJSON(data []byte) error {

v.Range = &DateMinMax{}

if min, ok := dateRangeData["min"].(string); ok {
minDate, err := time.Parse("2006-01-02T03:04:05", min)
if minimum, ok := dateRangeData["min"].(string); ok {
minDate, err := time.Parse("2006-01-02T03:04:05", minimum)
if err != nil {
return err
}

v.Range.Min = minDate
}

if max, ok := dateRangeData["max"].(string); ok {
maxDate, err := time.Parse("2006-01-02T03:04:05", max)
if maximum, ok := dateRangeData["max"].(string); ok {
maxDate, err := time.Parse("2006-01-02T03:04:05", maximum)
if err != nil {
return err
}
Expand Down

0 comments on commit 6e333c0

Please sign in to comment.