version

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "version",
	Short: "View version and commit information",
	Run: func(cmd *cobra.Command, args []string) {
		semver := build.Semver()
		commit := build.Commit()

		v := &versionCmd{
			Version: semver,
			Commit:  commit,
		}

		bi, ok := debug.ReadBuildInfo()
		if !ok {
			log.Printf("Failed to read build info")
			return
		}

		for _, dep := range bi.Deps {
			if strings.Contains(dep.Path, "github.com/onflow/") {
				v.Dependencies = append(v.Dependencies, *dep)
			}
		}

		if err := v.Print(command.Flags.Format); err != nil {
			log.Printf("Failed to print version information: %s", err)
			return
		}
	},
}

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