version

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package version implements the `mkit version` subcommand.

Index

Constants

This section is empty.

Variables

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print the mkit version",
	Long: `Print the mkit version.

The version is read from the Go module build info of this binary
(runtime/debug.ReadBuildInfo). For binaries built from a working tree it
reports (devel).`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Fprintf(cmd.OutOrStdout(), "mkit %s\n", ModuleVersion())
	},
}

VersionCmd prints the module version of the mkit binary.

Functions

func AddCommands

func AddCommands(rootCmd *cobra.Command)

func ModuleVersion

func ModuleVersion() string

ModuleVersion returns the module version from build info, falling back to "(devel)" when unavailable (e.g. `go run` or `go build` from a non-module-tagged working tree).

Types

This section is empty.

Jump to

Keyboard shortcuts

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