Skip to content

Commit

Permalink
fix: fix daemon packaging error
Browse files Browse the repository at this point in the history
use test path to test interface

Log:
  • Loading branch information
dengbo11 committed Jul 14, 2023
1 parent 7d546f6 commit 5ab3056
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions langselector1/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ func (lang *LangSelector) deleteLocale(locale string) error {
return nil
}

func getCurrentLocaleRegion() (string, error) {
func getCurrentLocaleRegion(path string) (string, error) {
var currentLocaleRegion string

infos, err := readEnvFile(localeConfigFile)
infos, err := readEnvFile(path)
if err != nil {
return currentLocaleRegion, err
}
Expand All @@ -692,7 +692,7 @@ func getCurrentLocaleRegion() (string, error) {

// 获取当前用户的locale region, 如果没有设置过,使用系统的locale region
func (lang *LangSelector) getLocaleRegion() (string, error) {
l, err := getCurrentLocaleRegion()
l, err := getCurrentLocaleRegion(localeConfigFile)
if err != nil {
logger.Warning("failed to get current locale region", err)
return lang.CurrentLocale, nil
Expand Down
2 changes: 1 addition & 1 deletion langselector1/locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ func Test_WriteLocaleRegionsEnvFile(t *testing.T) {
}

func Test_getCurrentLocaleRegione(t *testing.T) {
_, err := getCurrentLocaleRegion()
_, err := getCurrentLocaleRegion("testdata/pam_environment")
assert.NoError(t, err)
}

0 comments on commit 5ab3056

Please sign in to comment.