(values []ValueInterface)
| 149 | } |
| 150 | |
| 151 | func getMin(values []ValueInterface) (ValueInterface, error) { |
| 152 | if len(values) == 0 { |
| 153 | return nil, errors.New("can't extract min from empty array") |
| 154 | } |
| 155 | minValue := values[0] |
| 156 | |
| 157 | for _, value := range values[1:] { |
| 158 | if value.isSmallerThan(minValue) { |
| 159 | minValue = value |
| 160 | } |
| 161 | } |
| 162 | return minValue, nil |
| 163 | } |
| 164 | |
| 165 | func getMax(values []ValueInterface) (ValueInterface, error) { |
| 166 | if len(values) == 0 { |
no test coverage detected