version

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildAt string

BuildAt build time

View Source
var BuildBy string

BuildBy build user

View Source
var BuildVersion = "EXPERIMENTAL"

BuildVersion build verion

View Source
var Commit string

Commit commit

View Source
var GoVersion string

GoVersion go version

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print version",
	Run: func(cmd *cobra.Command, args []string) {
		v := New()
		content, err := json.Marshal(v)
		if err != nil {
			fmt.Printf("Cannot get version information: %v\n", err)
			return
		}
		fmt.Printf("%s\n", string(content))
	},
}

VersionCmd version command

Functions

This section is empty.

Types

type Version

type Version struct {
	Version   string
	BuildBy   string
	BuildAt   string
	GoVersion string
	Commit    string
}

Version verion object

func New

func New() Version

New create version object

Jump to

Keyboard shortcuts

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