MCPcopy Create free account
hub / github.com/cel-expr/cel-go / newStrictString

Method newStrictString

policy/parser.go:713–720  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

711// source position information. Intended for use in descriptions, where the string is just
712// a human-readable string for presentation.
713func (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.

Callers 1

ParsePolicyMethod · 0.95

Calls 2

CollectMetadataMethod · 0.95
assertYAMLTypeMethod · 0.95

Tested by

no test coverage detected