version

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name is the name of the compiled software.
	Name string
	// Version is the version of the compiled software.
	Version string
	// Branch is current branch name the code is built off.
	Branch string
	// Revision is the short commit hash of source tree.
	Revision string
	// BuildDate is the date when the binary was built.
	BuildDate string
)

go build -ldflags "-X version.Version=x.y.z"

View Source
var Cmd = &cobra.Command{
	Use:   "version",
	Short: "version相关辅助工具",
	Long:  `打印版本信息`,
	RunE: func(cmd *cobra.Command, args []string) error {
		fmt.Printf("goctl[%v]\n", Version)
		return nil
	},
}

Cmd represents the config command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL