add test for max int64 validator
This commit is contained in:
@@ -58,12 +58,14 @@ func (t *Int64ComponentInstance) Value() interface{} {
|
||||
|
||||
func (t *Int64ComponentInstance) FromJSON(component block.Component, data json.RawMessage) error {
|
||||
var s int64
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error unmarshalling property %s: %w", component.Identifier(), err)
|
||||
}
|
||||
|
||||
t.value = s
|
||||
if data != nil {
|
||||
err := json.Unmarshal(data, &s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t.value = s
|
||||
}
|
||||
|
||||
for _, v := range component.Validators() {
|
||||
if err := v(s); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user