add build tag to disable metrics

This commit is contained in:
Nicola Murino
2020-06-19 17:08:51 +02:00
parent b30614e9d8
commit 23a80b01b6
29 changed files with 189 additions and 109 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/spf13/viper"
"github.com/drakkan/sftpgo/config"
"github.com/drakkan/sftpgo/utils"
"github.com/drakkan/sftpgo/version"
)
const (
@@ -60,9 +60,8 @@ var (
)
func init() {
version := utils.GetAppVersion()
rootCmd.Flags().BoolP("version", "v", false, "")
rootCmd.Version = version.GetVersionAsString()
rootCmd.Version = version.GetAsString()
rootCmd.SetVersionTemplate(`{{printf "SFTPGo "}}{{printf "%s" .Version}}
`)
}