Files
amcs/vendor/github.com/getsentry/sentry-go/attribute/slicehelpers.go
T
Hein 1adf50e3db
CI / build-and-test (push) Failing after 1s
Release / release (push) Failing after 19m26s
fix(go.sum): update ResolveSpec dependency to v1.0.87
2026-06-23 13:17:16 +02:00

16 lines
254 B
Go

package attribute
import "reflect"
func asSlice[T any](v any) []T {
rv := reflect.ValueOf(v)
if rv.Kind() != reflect.Array {
return nil
}
cpy := make([]T, rv.Len())
if len(cpy) > 0 {
_ = reflect.Copy(reflect.ValueOf(cpy), rv)
}
return cpy
}