AssignTypeTo assigns this schema metadata to `node`. If `node` is not a yamlmeta.ArrayItem, `chk` contains a violation describing the mismatch If `node`'s value is not of the same structure (i.e. yamlmeta.Node type), `chk` contains a violation describing this mismatch
(node yamlmeta.Node)
| 128 | // If `node` is not a yamlmeta.ArrayItem, `chk` contains a violation describing the mismatch |
| 129 | // If `node`'s value is not of the same structure (i.e. yamlmeta.Node type), `chk` contains a violation describing this mismatch |
| 130 | func (a *ArrayItemType) AssignTypeTo(node yamlmeta.Node) TypeCheck { |
| 131 | chk := TypeCheck{} |
| 132 | arrayItem, ok := node.(*yamlmeta.ArrayItem) |
| 133 | if !ok { |
| 134 | chk.Violations = append(chk.Violations, NewMismatchedTypeAssertionError(node, a)) |
| 135 | return chk |
| 136 | } |
| 137 | SetType(node, a) |
| 138 | valueNode, isNode := arrayItem.Value.(yamlmeta.Node) |
| 139 | if isNode { |
| 140 | childCheck := a.ValueType.AssignTypeTo(valueNode) |
| 141 | chk.Violations = append(chk.Violations, childCheck.Violations...) |
| 142 | } // else, is scalar |
| 143 | return chk |
| 144 | } |
| 145 | |
| 146 | // AssignTypeTo returns a violation describing the type mismatch, given that ScalarType will never accept a yamlmeta.Node |
| 147 | func (s *ScalarType) AssignTypeTo(node yamlmeta.Node) TypeCheck { |
nothing calls this directly
no test coverage detected