mirror of
https://github.com/stretchr/testify.git
synced 2025-04-28 13:59:07 +00:00
15 lines
344 B
Plaintext
15 lines
344 B
Plaintext
case []{1}:
|
|
a := object.([]{1})
|
|
if isSet {
|
|
a[index] = value.({1})
|
|
} else {
|
|
if index >= len(a) {
|
|
if panics {
|
|
panic(fmt.Sprintf("objx: Index %d is out of range because the []{1} only contains %d items.", index, len(a)))
|
|
}
|
|
return nil
|
|
} else {
|
|
return a[index]
|
|
}
|
|
}
|