MCPcopy Index your code
hub / github.com/LissaGreense/GO4SQL / getMax

Function getMax

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

Source from the content-addressed store, hash-verified

163}
164
165func getMax(values []ValueInterface) (ValueInterface, error) {
166 if len(values) == 0 {
167 return nil, errors.New("can't extract max from empty array")
168 }
169
170 maxValue := values[0]
171 for _, value := range values[1:] {
172 if value.isGreaterThan(maxValue) {
173 maxValue = value
174 }
175 }
176
177 return maxValue, nil
178}

Callers 1

aggregateColumnContentFunction · 0.85

Calls 1

isGreaterThanMethod · 0.65

Tested by

no test coverage detected