File: array-access.txt

package info (click to toggle)
golang-objx 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 380 kB
  • sloc: makefile: 3
file content (14 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (7)
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]
      }
    }