From a9927763f43d59c418b264790ccee59defe8ca29 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 24 Oct 2023 08:38:40 +0200 Subject: refactor: Rename packages for clarity --- cmd/gettext/gettext.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cmd/gettext') diff --git a/cmd/gettext/gettext.go b/cmd/gettext/gettext.go index b753da8..2dbd65e 100644 --- a/cmd/gettext/gettext.go +++ b/cmd/gettext/gettext.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/martinlehoux/kagamigo/core" + "github.com/martinlehoux/kagamigo/kcore" "golang.org/x/exp/slog" "gopkg.in/yaml.v3" ) @@ -98,14 +98,14 @@ func extractAllKeys() map[string]int { err := filepath.Walk("templates", func(path string, info fs.FileInfo, err error) error { if !info.IsDir() && filepath.Ext(path) == ".html" { content, err := os.ReadFile(path) // #nosec G304 - core.Expect(err, "error reading file") + kcore.Expect(err, "error reading file") for key, value := range extractKeys(string(content)) { extractedKeys[key] = value } } return nil }) - core.Expect(err, "error walking templates directory") + kcore.Expect(err, "error walking templates directory") return extractedKeys } @@ -125,8 +125,8 @@ func main() { newLocales := make(map[string]string, 0) locales, err := os.ReadFile(filepath.Join("locales", lang, "index.yml")) // #nosec G304 - core.Expect(err, "error reading file") - core.Expect(yaml.Unmarshal(locales, ¤tLocales), "error unmarshalling yaml") + kcore.Expect(err, "error reading file") + kcore.Expect(yaml.Unmarshal(locales, ¤tLocales), "error unmarshalling yaml") correctLocales := 0 for key, translation := range currentLocales { @@ -157,8 +157,8 @@ func main() { if *write { content, err := yaml.Marshal(newLocales) - core.Expect(err, "error marshalling yaml") - core.Expect(os.WriteFile(filepath.Join("locales", lang, "index.yml"), content, 0600), "error writing file") + kcore.Expect(err, "error marshalling yaml") + kcore.Expect(os.WriteFile(filepath.Join("locales", lang, "index.yml"), content, 0600), "error writing file") } } } -- cgit v1.3