github.com/lino-network/lino@v0.6.11/app/version.go (about) 1 package app 2 3 import ( 4 "fmt" 5 6 "github.com/spf13/cobra" 7 // "github.com/spf13/viper" 8 ) 9 10 var Version = "" 11 12 // VersionCmd - print current version of binary. 13 func VersionCmd() *cobra.Command { 14 cmd := &cobra.Command{ 15 Use: "version", 16 Short: "version prints the version of this binary", 17 Args: cobra.NoArgs, 18 RunE: func(_ *cobra.Command, _ []string) error { 19 fmt.Println(Version) 20 return nil 21 }, 22 } 23 24 return cmd 25 }