MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / getMin

Function getMin

engine/generic_value.go:151–163  ·  view source on GitHub ↗
(values []ValueInterface)

Source from the content-addressed store, hash-verified

149}
150
151func 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
165func getMax(values []ValueInterface) (ValueInterface, error) {
166 if len(values) == 0 {

Callers 1

aggregateColumnContentFunction · 0.85

Calls 1

isSmallerThanMethod · 0.65

Tested by

no test coverage detected