newStrictString creates a new ValueString from the YAML node, but as a string with no special source position information. Intended for use in descriptions, where the string is just a human-readable string for presentation.
(node *yaml.Node)
| 711 | // source position information. Intended for use in descriptions, where the string is just |
| 712 | // a human-readable string for presentation. |
| 713 | func (p *parserImpl) newStrictString(node *yaml.Node) ValueString { |
| 714 | id := p.CollectMetadata(node) |
| 715 | nodeType := p.assertYAMLType(id, node, yamlString, yamlText) |
| 716 | if nodeType == nil { |
| 717 | return ValueString{ID: id, Value: "*error*"} |
| 718 | } |
| 719 | return ValueString{ID: id, Value: node.Value} |
| 720 | } |
| 721 | |
| 722 | // CollectMetadata records the source position information of a given YAML node, and returns |
| 723 | // the id associated with the source metadata which is returned in the Policy SourceInfo object. |
no test coverage detected