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

Method VersionNumber

common/env/env.go:502–520  ·  view source on GitHub ↗

VersionNumber returns the parsed version string, or an error if the version cannot be parsed.

()

Source from the content-addressed store, hash-verified

500
501// VersionNumber returns the parsed version string, or an error if the version cannot be parsed.
502func (e *Extension) VersionNumber() (uint32, error) {
503 if e == nil {
504 return 0, fmt.Errorf("invalid extension: nil")
505 }
506 if e.Name == "" {
507 return 0, fmt.Errorf("invalid extension: missing name")
508 }
509 if e.Version == "latest" {
510 return math.MaxUint32, nil
511 }
512 if e.Version == "" {
513 return 0, nil
514 }
515 ver, err := strconv.ParseUint(e.Version, 10, 32)
516 if err != nil {
517 return 0, fmt.Errorf("invalid extension %q version: %w", e.Name, err)
518 }
519 return uint32(ver), nil
520}
521
522// NewLibrarySubset returns an empty library subsetting config which permits all library features.
523func NewLibrarySubset() *LibrarySubset {

Callers 4

ValidateMethod · 0.95
ExtensionOptionFactoryFunction · 0.80
configToEnvOptionsFunction · 0.80
TestExtensionGetVersionFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestExtensionGetVersionFunction · 0.64