Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Fix string length validation error printing pointers not values (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
itowlson authored Nov 26, 2018
1 parent 41054b2 commit 2342011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/bundle/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ func (pd ParameterDefinition) validateStringParameterValue(value interface{}) er
return errors.New("value is not a string")
}
if pd.MinLength != nil && len(s) < *pd.MinLength {
return fmt.Errorf("value is too short: minimum length is %d", pd.MinLength)
return fmt.Errorf("value is too short: minimum length is %d", *pd.MinLength)
}
if pd.MaxLength != nil && len(s) > *pd.MaxLength {
return fmt.Errorf("value is too long: maximum length is %d", pd.MaxLength)
return fmt.Errorf("value is too long: maximum length is %d", *pd.MaxLength)
}
return nil
}
Expand Down

0 comments on commit 2342011

Please sign in to comment.