fix(build/llu): fix golang lint errors

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-03-12 22:31:44 +01:00
parent 7fced29615
commit 508c5b39e2
2 changed files with 10 additions and 10 deletions

View file

@ -221,10 +221,9 @@ func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
Kind: "Template parser",
Err: err,
}
} else {
omh.handleTemplateFileNodes(fset, tmplParsed.Tree.Root.Nodes)
return nil
}
omh.handleTemplateFileNodes(fset, tmplParsed.Tree.Root.Nodes)
return nil
}
// This command assumes that we get started from the project root directory
@ -240,11 +239,12 @@ func (omh OnMsgidHandler) HandleTemplateFile(fname string, src any) error {
// 2 unable to parse locale ini/json files
// 3 unable to parse go or text/template files
// 4 found missing message IDs
//
//nolint:forbidigo
func main() {
allowMissingMsgids := false
for _, arg := range os.Args {
switch arg {
case "--allow-missing-msgids":
for _, arg := range os.Args[1:] {
if arg == "--allow-missing-msgids" {
allowMissingMsgids = true
}
}

View file

@ -32,13 +32,13 @@ func HandleTemplateFileWrapped(t *testing.T, fname, src string) []string {
func TestUsagesParser(t *testing.T) {
t.Run("go, simple", func(t *testing.T) {
assert.EqualValues(t,
HandleGoFileWrapped(t, "<g1>", "package main\nfunc Render(ctx *context.Context) string { return ctx.Tr(\"what.an.example\"); }\n"),
[]string{"what.an.example"})
[]string{"what.an.example"},
HandleGoFileWrapped(t, "<g1>", "package main\nfunc Render(ctx *context.Context) string { return ctx.Tr(\"what.an.example\"); }\n"))
})
t.Run("template, simple", func(t *testing.T) {
assert.EqualValues(t,
HandleTemplateFileWrapped(t, "<t1>", "{{ ctx.Locale.Tr \"what.an.example\" }}\n"),
[]string{"what.an.example"})
[]string{"what.an.example"},
HandleTemplateFileWrapped(t, "<t1>", "{{ ctx.Locale.Tr \"what.an.example\" }}\n"))
})
}