func()

in toolkit/log/span.go [26:41]


func (s *otelSpan) getAttribute(k string, v interface{}) attribute.KeyValue {
	switch val := v.(type) {
	case string:
		return attribute.String(k, val)
	case int:
		return attribute.Int64(k, int64(val))
	case int64:
		return attribute.Int64(k, val)
	case float64:
		return attribute.Float64(k, val)
	case bool:
		return attribute.Bool(k, val)
	default:
		return attribute.String(k, fmt.Sprintf("%v", val))
	}
}