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

Method newStrictString

policy/parser.go:671–678  ·  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

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

Callers 1

ParsePolicyMethod · 0.95

Calls 2

CollectMetadataMethod · 0.95
assertYAMLTypeMethod · 0.95

Tested by

no test coverage detected