mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-29 16:31:20 -05:00
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.3 to 2.2.4. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.2.3...v2.2.4) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
36 lines
728 B
Go
36 lines
728 B
Go
package sysutil
|
|
|
|
import (
|
|
"runtime"
|
|
|
|
"github.com/gookit/goutil/goinfo"
|
|
)
|
|
|
|
// GoVersion get go runtime version. eg: "1.18.2"
|
|
func GoVersion() string {
|
|
return runtime.Version()[2:]
|
|
}
|
|
|
|
// GoInfo define. alias of goinfo.GoInfo
|
|
type GoInfo = goinfo.GoInfo
|
|
|
|
// ParseGoVersion get info by parse `go version` results. alias of goinfo.ParseGoVersion()
|
|
//
|
|
// Examples:
|
|
//
|
|
// line, err := sysutil.ExecLine("go version")
|
|
// if err != nil {
|
|
// return err
|
|
// }
|
|
//
|
|
// info, err := sysutil.ParseGoVersion()
|
|
// dump.P(info)
|
|
func ParseGoVersion(line string) (*GoInfo, error) {
|
|
return goinfo.ParseGoVersion(line)
|
|
}
|
|
|
|
// OsGoInfo fetch and parse. alias of goinfo.OsGoInfo()
|
|
func OsGoInfo() (*GoInfo, error) {
|
|
return goinfo.OsGoInfo()
|
|
}
|