From 59998b0b8473d05ad631ad25ca517f6522611657 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 26 Jun 2024 20:27:22 +0530 Subject: [PATCH] Bubble up parsing error from en.json (#27362) Running `make i18n-extract` on a en.json file with bad JSON will just wipe off all keys instead of throwing the error. This is very confusing and can lead to a lot of time wasted because there's no indication that the JSON is incorrect. Fixing this. ```release-note NONE ``` --- tools/mmgotool/commands/i18n.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mmgotool/commands/i18n.go b/tools/mmgotool/commands/i18n.go index be7a1cc70e..5e7c12d767 100644 --- a/tools/mmgotool/commands/i18n.go +++ b/tools/mmgotool/commands/i18n.go @@ -113,8 +113,8 @@ func getBaseFileSrcStrings(mattermostDir string) ([]Translation, error) { return nil, err } var translations []Translation - _ = json.Unmarshal(jsonFile, &translations) - return translations, nil + err = json.Unmarshal(jsonFile, &translations) + return translations, err } func extractSrcStrings(enterpriseDir, mattermostDir, modelDir, pluginDir, portalDir string) map[string]bool {