code: func setAggregationValueIfPresent(aggName core.AggregationType, rawVal []interface{}, aggregations *core.AggregationValue, indexLookup map[core.AggregationType]int, wasInt map[string]bool) error {
  	if fieldIndex, ok := indexLookup[aggName]; ok {
  		targetValue := &core.MetricValue{}
  		if err := tryParseMetricValue(string(aggName), rawVal, targetValue, fieldIndex, wasInt); err != nil {
  			return err
  		}
  
  		aggregations.Aggregations[aggName] = *targetValue
  	}
  
  	return nil
  }
docs: // setAggregationValueIfPresent checks if the given metric value is present in the list of raw values, and if so,
  // copies it to the output format