version

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVersion = "EXPERIMENTAL"
)

Variables

View Source
var BuildAt string

BuildAt build time

View Source
var BuildBy string

BuildBy build user

View Source
var BuildVersion string

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