From 1ad821b2b75f87259b563e26fda3d335069e6841 Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Tue, 1 Nov 2022 13:29:27 +0100 Subject: [PATCH] GODT-2011: Use new app version format --- internal/constants/constants.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/constants/constants.go b/internal/constants/constants.go index b5ad8a58..b3e7ea59 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -21,9 +21,6 @@ package constants import ( "fmt" "runtime" - - "golang.org/x/text/cases" - "golang.org/x/text/language" ) const VendorName = "protonmail" @@ -68,21 +65,22 @@ const ( // AppVersion returns the full rendered version of the app (to be used in request headers). func AppVersion(version string) string { - return getAPIOS() + cases.Title(language.Und).String(AppName) + "_" + version + return fmt.Sprintf("%v-%v@%v", getAPIOS(), AppName, version) } +// nolint:goconst func getAPIOS() string { switch runtime.GOOS { case "darwin": - return "macOS" + return "macos" case "linux": - return "Linux" + return "linux" case "windows": - return "Windows" + return "windows" default: - return "Linux" + return "linux" } }