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)
| 669 | // source position information. Intended for use in descriptions, where the string is just |
| 670 | // a human-readable string for presentation. |
| 671 | func (p *parserImpl) newStrictString(node *yaml.Node) ValueString { |
| 672 | id := p.CollectMetadata(node) |
| 673 | nodeType := p.assertYAMLType(id, node, yamlString, yamlText) |
| 674 | if nodeType == nil { |
| 675 | return ValueString{ID: id, Value: "*error*"} |
| 676 | } |
| 677 | return ValueString{ID: id, Value: node.Value} |
| 678 | } |
| 679 | |
| 680 | // CollectMetadata records the source position information of a given YAML node, and returns |
| 681 | // the id associated with the source metadata which is returned in the Policy SourceInfo object. |
no test coverage detected