Bumps the minor-and-patch group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/beevik/etree](https://github.com/beevik/etree) | `1.6.0` | `1.7.0` | | [github.com/coreos/go-oidc/v3](https://github.com/coreos/go-oidc) | `3.19.0` | `3.20.0` | | [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) | `5.3.0` | `5.3.1` | | [github.com/go-ldap/ldap/v3](https://github.com/go-ldap/ldap) | `3.4.13` | `3.4.14` | | [github.com/kovidgoyal/imaging](https://github.com/kovidgoyal/imaging) | `1.8.22` | `1.8.23` | | [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.82.0` | `1.82.1` | Updates `github.com/beevik/etree` from 1.6.0 to 1.7.0 - [Release notes](https://github.com/beevik/etree/releases) - [Changelog](https://github.com/beevik/etree/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/beevik/etree/compare/v1.6.0...v1.7.0) Updates `github.com/coreos/go-oidc/v3` from 3.19.0 to 3.20.0 - [Release notes](https://github.com/coreos/go-oidc/releases) - [Commits](https://github.com/coreos/go-oidc/compare/v3.19.0...v3.20.0) Updates `github.com/go-chi/chi/v5` from 5.3.0 to 5.3.1 - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-chi/chi/compare/v5.3.0...v5.3.1) Updates `github.com/go-ldap/ldap/v3` from 3.4.13 to 3.4.14 - [Release notes](https://github.com/go-ldap/ldap/releases) - [Commits](https://github.com/go-ldap/ldap/compare/v3.4.13...v3.4.14) Updates `github.com/kovidgoyal/imaging` from 1.8.22 to 1.8.23 - [Release notes](https://github.com/kovidgoyal/imaging/releases) - [Commits](https://github.com/kovidgoyal/imaging/compare/v1.8.22...v1.8.23) Updates `golang.org/x/crypto` from 0.53.0 to 0.54.0 - [Commits](https://github.com/golang/crypto/compare/v0.53.0...v0.54.0) Updates `golang.org/x/image` from 0.43.0 to 0.44.0 - [Commits](https://github.com/golang/image/compare/v0.43.0...v0.44.0) Updates `golang.org/x/net` from 0.56.0 to 0.57.0 - [Commits](https://github.com/golang/net/compare/v0.56.0...v0.57.0) Updates `golang.org/x/sync` from 0.21.0 to 0.22.0 - [Commits](https://github.com/golang/sync/compare/v0.21.0...v0.22.0) Updates `golang.org/x/term` from 0.44.0 to 0.45.0 - [Commits](https://github.com/golang/term/compare/v0.44.0...v0.45.0) Updates `golang.org/x/text` from 0.38.0 to 0.40.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.38.0...v0.40.0) Updates `google.golang.org/grpc` from 1.82.0 to 1.82.1 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.82.0...v1.82.1) --- updated-dependencies: - dependency-name: github.com/beevik/etree dependency-version: 1.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/coreos/go-oidc/v3 dependency-version: 3.20.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/go-chi/chi/v5 dependency-version: 5.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: github.com/go-ldap/ldap/v3 dependency-version: 3.4.14 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: github.com/kovidgoyal/imaging dependency-version: 1.8.23 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: golang.org/x/crypto dependency-version: 0.54.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/image dependency-version: 0.44.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/net dependency-version: 0.57.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/sync dependency-version: 0.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/term dependency-version: 0.45.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/text dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: google.golang.org/grpc dependency-version: 1.82.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
56 lines
1.6 KiB
Go
56 lines
1.6 KiB
Go
// Copyright 2022 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package cpu
|
|
|
|
import "strconv"
|
|
|
|
// parseRelease parses a dot-separated version number from the prefix
|
|
// of rel. It returns ok=true only if at least the major and minor
|
|
// components were successfully parsed; the patch component is
|
|
// best-effort. Trailing vendor or build suffixes such as
|
|
// "-generic", "+", "_hi3535", or "-rc1" are ignored.
|
|
//
|
|
// This is a copy of the Go runtime's parseRelease from
|
|
// https://golang.org/cl/209597, updated in https://golang.org/cl/781800.
|
|
func parseRelease(rel string) (major, minor, patch int, ok bool) {
|
|
// next consumes a run of decimal digits from the front of rel,
|
|
// returning the parsed value. If the digits are followed by a
|
|
// '.', it is consumed and more is set so the caller knows to
|
|
// parse another component; otherwise scanning terminates and
|
|
// the rest of rel is discarded.
|
|
next := func() (n int, more, ok bool) {
|
|
i := 0
|
|
for i < len(rel) && rel[i] >= '0' && rel[i] <= '9' {
|
|
i++
|
|
}
|
|
if i == 0 {
|
|
return 0, false, false
|
|
}
|
|
n, err := strconv.Atoi(rel[:i])
|
|
if err != nil {
|
|
return 0, false, false
|
|
}
|
|
if i < len(rel) && rel[i] == '.' {
|
|
rel = rel[i+1:]
|
|
return n, true, true
|
|
}
|
|
rel = ""
|
|
return n, false, true
|
|
}
|
|
|
|
var more bool
|
|
if major, more, ok = next(); !ok || !more {
|
|
return 0, 0, 0, false
|
|
}
|
|
if minor, more, ok = next(); !ok {
|
|
return 0, 0, 0, false
|
|
}
|
|
if !more {
|
|
return major, minor, 0, true
|
|
}
|
|
patch, _, _ = next()
|
|
return major, minor, patch, true
|
|
}
|