refactore: refactoring of code

This commit is contained in:
2024-01-19 14:41:25 +01:00
parent 858b508b58
commit 52ed96ae09
6 changed files with 40 additions and 20 deletions

23
cmd/version.go Normal file
View File

@@ -0,0 +1,23 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"os"
)
var appVersion = os.Getenv("VERSION")
var VersionCmd = &cobra.Command{
Use: "version",
Short: "Show version",
Run: func(cmd *cobra.Command, args []string) {
Version()
},
}
// Version display application version
func Version() {
fmt.Printf("Version: %s \n", appVersion)
fmt.Print()
}