From a9ebed115563c582865cfb30ddb3879f66ebf9b8 Mon Sep 17 00:00:00 2001 From: devexdev <36765991+devexdev@users.noreply.github.com> Date: Tue, 25 Oct 2022 11:19:59 -0500 Subject: [PATCH 1/3] build(deps): Bump golang.org/x/text (#346) * Update go.mod * Update go.sum --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index f0ddd0c..b8bf97a 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.2.2 golang.org/x/crypto v0.0.0-20211202192323-5770296d904e - golang.org/x/text v0.3.7 + golang.org/x/text v0.4.0 gopkg.in/cheggaaa/pb.v1 v1.0.15 gopkg.in/yaml.v2 v2.4.0 ) @@ -28,7 +28,7 @@ require ( github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect google.golang.org/protobuf v1.26.0 // indirect diff --git a/go.sum b/go.sum index b79e60a..c732b52 100644 --- a/go.sum +++ b/go.sum @@ -152,6 +152,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -159,6 +161,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 5f890a966c8311e034cb83726278f419f2dcee50 Mon Sep 17 00:00:00 2001 From: Aerex Date: Mon, 31 Oct 2022 10:06:50 -0500 Subject: [PATCH 2/3] fix: Used messageID as translation if translation cannot be found (#348) --- i18n/i18n.go | 11 +++++------ plugin_examples/list_plugin/commands/list_test.go | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/i18n/i18n.go b/i18n/i18n.go index 66271da..b026e49 100644 --- a/i18n/i18n.go +++ b/i18n/i18n.go @@ -20,10 +20,9 @@ const ( ) var ( - bundle *i18n.Bundle - T TranslateFunc - RESOURCE_PATH = filepath.Join("i18n", "resources") - TRANSLATION_NOT_FOUND = "!!i18N_MESSAGE_NOT_FOUND!!" + bundle *i18n.Bundle + T TranslateFunc + RESOURCE_PATH = filepath.Join("i18n", "resources") ) func init() { @@ -83,9 +82,9 @@ func Translate(loc *i18n.Localizer) TranslateFunc { // If no message is returned we can assume that that // the translation could not be found in any of the files - // Set the message as !!i18N_MESSAGE_NOT_FOUND!! + // Set the message as the messageID if msg == "" { - msg = TRANSLATION_NOT_FOUND + msg = messageId } return msg diff --git a/plugin_examples/list_plugin/commands/list_test.go b/plugin_examples/list_plugin/commands/list_test.go index 6d3ca97..90bbf26 100644 --- a/plugin_examples/list_plugin/commands/list_test.go +++ b/plugin_examples/list_plugin/commands/list_test.go @@ -2,7 +2,6 @@ package commands_test import ( sdkmodels "github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/models" - "github.com/IBM-Cloud/ibm-cloud-cli-sdk/i18n" "github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin/pluginfakes" "github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin_examples/list_plugin/api/fakes" . "github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin_examples/list_plugin/commands" @@ -46,7 +45,7 @@ var _ = Describe("ListCommand", func() { It("Should fail", func() { err = cmd.Run([]string{}) Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal(i18n.TRANSLATION_NOT_FOUND)) + Expect(err.Error()).To(Equal("No CF API endpoint set. Use '{{.Command}}' to target a CloudFoundry environment.")) }) }) }) From 46ece334df766c8b8c8655530b56ecb5ba6ec1cf Mon Sep 17 00:00:00 2001 From: Aerex Date: Mon, 31 Oct 2022 10:08:55 -0500 Subject: [PATCH 3/3] chore: Bumped to 1.0.1 --- bluemix/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluemix/version.go b/bluemix/version.go index 1ff62d1..6065a7f 100644 --- a/bluemix/version.go +++ b/bluemix/version.go @@ -3,7 +3,7 @@ package bluemix import "fmt" // Version is the SDK version -var Version = VersionType{Major: 1, Minor: 0, Build: 0} +var Version = VersionType{Major: 1, Minor: 0, Build: 1} // VersionType describe version info type VersionType struct {