代码拉取完成,页面将自动刷新
package libpod
import (
"runtime"
"strconv"
podmanVersion "github.com/projectatomic/libpod/version"
)
// Overwritten at build time
var (
// GitCommit is the commit that the binary is being built from.
// It will be populated by the Makefile.
GitCommit string
// BuildInfo is the time at which the binary was built
// It will be populated by the Makefile.
BuildInfo string
)
//Version is an output struct for varlink
type Version struct {
Version string
GoVersion string
GitCommit string
Built int64
OsArch string
}
// GetVersion returns a VersionOutput struct for varlink and podman
func GetVersion() (Version, error) {
var err error
var buildTime int64
if BuildInfo != "" {
// Converts unix time from string to int64
buildTime, err = strconv.ParseInt(BuildInfo, 10, 64)
if err != nil {
return Version{}, err
}
}
return Version{
Version: podmanVersion.Version,
GoVersion: runtime.Version(),
GitCommit: GitCommit,
Built: buildTime,
OsArch: runtime.GOOS + "/" + runtime.GOARCH,
}, nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。