代码拉取完成,页面将自动刷新
//
// Show our version.
//
package main
import (
"context"
"flag"
"fmt"
"runtime"
"github.com/google/subcommands"
)
var (
version = "unreleased"
)
type versionCmd struct {
verbose bool
}
//
// Glue
//
func (*versionCmd) Name() string { return "version" }
func (*versionCmd) Synopsis() string { return "Show our version." }
func (*versionCmd) Usage() string {
return `version :
Report upon our version, and exit.
`
}
//
// Flag setup
//
func (p *versionCmd) SetFlags(f *flag.FlagSet) {
f.BoolVar(&p.verbose, "verbose", false, "Show go version the binary was generated with.")
}
//
// Show the version - using the "out"-writer.
//
func showVersion(verbose bool) {
fmt.Printf("%s\n", version)
if verbose {
fmt.Printf("Built with %s\n", runtime.Version())
}
}
//
// Entry-point.
//
func (p *versionCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
showVersion(p.verbose)
return subcommands.ExitSuccess
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。