From d7dee9ca1bf6d8efdfe228b2b889c52d6f4953d1 Mon Sep 17 00:00:00 2001 From: Arjan H Date: Mon, 15 Aug 2022 19:32:30 +0200 Subject: [PATCH] Refactor some deprecated code --- gui/go.mod | 2 +- gui/main.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/go.mod b/gui/go.mod index df1f11f..133c92a 100644 --- a/gui/go.mod +++ b/gui/go.mod @@ -14,6 +14,7 @@ require ( github.com/nbutton23/zxcvbn-go v0.0.0-20201221231540-e56b841a3c88 github.com/spf13/viper v1.7.1 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + golang.org/x/text v0.3.2 ) require ( @@ -31,7 +32,6 @@ require ( github.com/spf13/pflag v1.0.3 // indirect github.com/subosito/gotenv v1.2.0 // indirect golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect - golang.org/x/text v0.3.2 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.2.4 // indirect ) diff --git a/gui/main.go b/gui/main.go index 6387cf5..588eb34 100644 --- a/gui/main.go +++ b/gui/main.go @@ -43,6 +43,8 @@ import ( "github.com/nbutton23/zxcvbn-go" "github.com/spf13/viper" "golang.org/x/crypto/bcrypt" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) const ( @@ -1472,7 +1474,7 @@ func _certCreate(w http.ResponseWriter, r *http.Request, certBase string, isRoot } if err := ci.Create(path, certBase); err != nil { - ci.Errors[strings.Title(ci.CreateType)] = err.Error() + ci.Errors[cases.Title(language.Und).String(ci.CreateType)] = err.Error() log.Printf("_certCreate: create failed: %v", err) render(w, r, "cert:manage", map[string]interface{}{"CertificateInfo": ci, "Progress": _progress(certBase), "HelpText": _helptext(certBase)}) return false