Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix late i18n init #79

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion windows-agent/cmd/ubuntu-pro-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
//go:generate go run ../generate_completion_documentation.go update-doc-cli-ref

func main() {
i18n.InitI18nDomain(common.TEXTDOMAIN)
a := agent.New()
os.Exit(run(a))
}
Expand All @@ -30,7 +31,6 @@ type app interface {
}

func run(a app) int {
i18n.InitI18nDomain(common.TEXTDOMAIN)
defer installSignalHandler(a)()

log.SetFormatter(&log.TextFormatter{
Expand Down
2 changes: 1 addition & 1 deletion wsl-pro-service/cmd/wsl-pro-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
//go:generate go run ../generate_completion_documentation.go update-doc-cli-ref

func main() {
i18n.InitI18nDomain(common.TEXTDOMAIN)
a := service.New()
os.Exit(run(a))
}
Expand All @@ -30,7 +31,6 @@ type app interface {
}

func run(a app) int {
i18n.InitI18nDomain(common.TEXTDOMAIN)
defer installSignalHandler(a)()

log.SetFormatter(&log.TextFormatter{
Expand Down
4 changes: 4 additions & 0 deletions wsl-pro-service/cmd/wsl-pro-service/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestRunSignal(t *testing.T) {
}

func TestRun(t *testing.T) {
t.Parallel()

tests := map[string]struct {
runError bool
usageErrorReturn bool
Expand All @@ -78,6 +80,8 @@ func TestRun(t *testing.T) {
for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()

a := myApp{
done: make(chan struct{}),
runError: tc.runError,
Expand Down