summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/stretchr/objx/codegen/array-access.txt
blob: 30602347512c3d61110e58a1bd8ed8a6c52ca3bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  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]
      }
    }