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

Method HasExtension

common/ast/ast.go:453–458  ·  view source on GitHub ↗

HasExtension returns whether the source info contains the extension which satisfies the minimum version requirement. For an extension to be considered 'present' it must have the same major version as the minVersion and a minor version at least as great as the lowest minor version specified.

(id string, minVersion ExtensionVersion)

Source from the content-addressed store, hash-verified

451// For an extension to be considered 'present' it must have the same major version as the minVersion and a minor version
452// at least as great as the lowest minor version specified.
453func (s *SourceInfo) HasExtension(id string, minVersion ExtensionVersion) bool {
454 for _, ext := range s.Extensions() {
455 return ext.ID == id && ext.Version.Major == minVersion.Major && ext.Version.Minor >= minVersion.Minor
456 }
457 return false
458}
459
460// AddExtension adds an extension record into the SourceInfo.
461func (s *SourceInfo) AddExtension(ext Extension) {

Callers 2

TestHasExtensionFunction · 0.95
newProgramFunction · 0.80

Calls 1

ExtensionsMethod · 0.95

Tested by 1

TestHasExtensionFunction · 0.76