[[CUE]]は、オプションフィールドを一括指定する機能をもつ。
これにより、構造体の各フィールドに統一される制約(テンプレート)を指定できる。
[Templates | CUE](https://cuelang.org/docs/tutorials/tour/types/templates/)
テンプレート化できるのは構造体のみ?
```cue
job: [Name=_]: {
name: Name
replicas: uint | *1
command: string
}
job: list: command: "ls"
job: nginx: {
command: "nginx"
replicas: 2
}
```
$ cue eval templates.cue
```cue
job: {
list: {
name: "list"
replicas: 1
command: "ls"
}
nginx: {
name: "nginx"
replicas: 2
command: "nginx"
}
}
```
参考: [cuelang kubernetes チュートリアル#2 - tjtjtjのメモ](https://tjtjtj.hatenablog.com/entry/2020/09/18/083722)