File: array-access.txt

package info (click to toggle)
golang-objx 0.0~git20150928.0.1a9d0bb-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 324 kB
  • sloc: makefile: 5
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]
      }
    }