Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶
func Aggregate[T any](dst, src T)
Aggregate aggregates src and dst into dst using reflection where T should be a pointer to a struct, otherwise, it panics. The logic depends on the prefix of the Field's Name; If it starts with:
- "Total": sum of the two values.
- "Max" or "EnhancedMax": max value between the two values.
- "Min" or "EnhancedMin": min value between the two values.
- "Avg" or "EnhancedAvg": avg of the two values.
- "Num" and ends with "s": sum of the two values. (e.g. NumSplits, NumLaps, NumSessions)
- Otherwise: fill with src's Value only if dst's Value is invalid.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.