AssignTypeTo assigns this schema metadata to `node`. If `node` is not a yamlmeta.Array, `chk` contains a violation describing the mismatch For each `node`'s yamlmeta.ArrayItem's that cannot be assigned this ArrayType's ArrayItemType, `chk` contains a violation describing the mismatch
(node yamlmeta.Node)
| 109 | // If `node` is not a yamlmeta.Array, `chk` contains a violation describing the mismatch |
| 110 | // For each `node`'s yamlmeta.ArrayItem's that cannot be assigned this ArrayType's ArrayItemType, `chk` contains a violation describing the mismatch |
| 111 | func (a *ArrayType) AssignTypeTo(node yamlmeta.Node) TypeCheck { |
| 112 | chk := TypeCheck{} |
| 113 | arrayNode, ok := node.(*yamlmeta.Array) |
| 114 | if !ok { |
| 115 | chk.Violations = append(chk.Violations, NewMismatchedTypeAssertionError(node, a)) |
| 116 | return chk |
| 117 | } |
| 118 | SetType(node, a) |
| 119 | for _, arrayItem := range arrayNode.Items { |
| 120 | childCheck := a.ItemsType.AssignTypeTo(arrayItem) |
| 121 | chk.Violations = append(chk.Violations, childCheck.Violations...) |
| 122 | } |
| 123 | return chk |
| 124 | } |
| 125 | |
| 126 | // AssignTypeTo assigns this schema metadata to `node`. |
| 127 | // |
nothing calls this directly
no test coverage detected