File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package i18n
17
17
import (
18
18
"context"
19
19
"net/http"
20
+ "runtime"
20
21
21
22
"github.com/erda-project/erda/pkg/goroutine_context"
22
23
)
@@ -41,6 +42,11 @@ func GetLocaleNameByRequest(request *http.Request) string {
41
42
}
42
43
43
44
func GetGoroutineBindLang () string {
45
+ // mac system use goroutine_context.GetContext() will panic
46
+ if runtime .GOOS == "darwin" {
47
+ return ""
48
+ }
49
+
44
50
globalContext := goroutine_context .GetContext ()
45
51
if globalContext == nil {
46
52
return ""
@@ -58,6 +64,11 @@ func GetGoroutineBindLang() string {
58
64
}
59
65
60
66
func SetGoroutineBindLang (localeName string ) {
67
+ // mac system use goroutine_context.GetContext() will panic
68
+ if runtime .GOOS == "darwin" {
69
+ return
70
+ }
71
+
61
72
ctx := goroutine_context .GetContext ()
62
73
if ctx == nil {
63
74
ctx = context .Background ()
You can’t perform that action at this time.
0 commit comments