code: func Canonicalize(fields []Field, fieldVals []interface{}) ([]interface{}, error) {
  	if len(fieldVals) != len(fields) {
  		return nil, fmt.Errorf("metric: got %d field values, want %d: %v",
  			len(fieldVals), len(fields), fieldVals)
  	}
  
  	out := make([]interface{}, 0, len(fields))
  	for i, f := range fields {
  		fv, ok := fieldVals[i], false
  
  		switch f.Type {
  		case StringType:
  			_, ok = fv.(string)
  		case BoolType:
  			_, ok = fv.(bool)
  		case IntType:
  			if _, ok = fv.(int64); !ok {
  				if fvi, oki := fv.(int); oki {
  					fv, ok = int64(fvi), true
  				} else if fvi, oki := fv.(int32); oki {
  					fv, ok = int64(fvi), true
  				}
  			}
  		}
  
  		if !ok {
  			return nil, fmt.Errorf(
  				"metric: field %s = %T(%v), want %v", f.Name, fv, fv, f.Type)
  		}
  		out = append(out, fv)
  	}
  	return out, nil
  }
docs: // Canonicalize returns a copy of fieldVals converted to the canonical types for
  // the metric's fields (string, int64, or bool).  Canonicalize returns an error
  // if fieldVals is the wrong length or contains value of the wrong type.