Skip to content

Commit 53400d2

Browse files
authored
If it is a MAC system, skip the global configuration internationalization information (#3429)
1 parent 6a7e437 commit 53400d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/i18n/helper.go

+11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package i18n
1717
import (
1818
"context"
1919
"net/http"
20+
"runtime"
2021

2122
"github.com/erda-project/erda/pkg/goroutine_context"
2223
)
@@ -41,6 +42,11 @@ func GetLocaleNameByRequest(request *http.Request) string {
4142
}
4243

4344
func GetGoroutineBindLang() string {
45+
// mac system use goroutine_context.GetContext() will panic
46+
if runtime.GOOS == "darwin" {
47+
return ""
48+
}
49+
4450
globalContext := goroutine_context.GetContext()
4551
if globalContext == nil {
4652
return ""
@@ -58,6 +64,11 @@ func GetGoroutineBindLang() string {
5864
}
5965

6066
func SetGoroutineBindLang(localeName string) {
67+
// mac system use goroutine_context.GetContext() will panic
68+
if runtime.GOOS == "darwin" {
69+
return
70+
}
71+
6172
ctx := goroutine_context.GetContext()
6273
if ctx == nil {
6374
ctx = context.Background()

0 commit comments

Comments
 (0)