blob: f64fadb9ec68366d09d1f7f6f0fb86e2ab8d6065 [file] [log] [blame] [view]
[TOC](Readme.md) [Prev](scopes.md) [Next](aliases.md)
# Accessing Fields
Selectors access fields within a struct using the `.` notation.
This only works if a field name is a valid identifier and it is not computed.
For other cases one can use the indexing notation.
<!-- CUE editor -->
```
a: {
b: 2
"c-e": 5
}
v: a.b
w: a["c-e"]
```
<!-- result -->
```
a: {
b: 2
}
v: 2
w: 5
```