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

Method HasExtension

common/ast/ast.go:445–450  ·  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

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

Callers 2

TestHasExtensionFunction · 0.95
newProgramFunction · 0.80

Calls 1

ExtensionsMethod · 0.95

Tested by 1

TestHasExtensionFunction · 0.76