VersionNumber returns the parsed version string, or an error if the version cannot be parsed.
()
| 500 | |
| 501 | // VersionNumber returns the parsed version string, or an error if the version cannot be parsed. |
| 502 | func (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. |
| 523 | func NewLibrarySubset() *LibrarySubset { |
no outgoing calls