AssignTypeTo assigns this schema metadata to `node`. If `node` is not a yamlmeta.Document, `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)
| 15 | // If `node` is not a yamlmeta.Document, `chk` contains a violation describing the mismatch |
| 16 | // If `node`'s value is not of the same structure (i.e. yamlmeta.Node type), `chk` contains a violation describing this mismatch |
| 17 | func (t *DocumentType) AssignTypeTo(node yamlmeta.Node) TypeCheck { |
| 18 | chk := TypeCheck{} |
| 19 | doc, ok := node.(*yamlmeta.Document) |
| 20 | if !ok { |
| 21 | chk.Violations = append(chk.Violations, NewMismatchedTypeAssertionError(node, t)) |
| 22 | return chk |
| 23 | } |
| 24 | SetType(doc, t) |
| 25 | valueNode, isNode := doc.Value.(yamlmeta.Node) |
| 26 | if isNode { |
| 27 | childCheck := t.ValueType.AssignTypeTo(valueNode) |
| 28 | chk.Violations = append(chk.Violations, childCheck.Violations...) |
| 29 | } // else, is a scalar |
| 30 | return chk |
| 31 | } |
| 32 | |
| 33 | // AssignTypeTo assigns this schema metadata to `node`. |
| 34 | // |
nothing calls this directly
no test coverage detected