version

package
v1.20.5 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

		v := &versionCmd{
			Version: semver,
		}

		bi, ok := debug.ReadBuildInfo()
		if !ok {
			return fmt.Errorf("failed to read build info")
		}

		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 {
			return err
		}

		return nil
	},
}

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