This commit is contained in:
yun
2024-11-10 22:55:35 +08:00
parent 7eaf21634c
commit 046091cb35
2 changed files with 54 additions and 0 deletions
+4
View File
@@ -4,6 +4,8 @@ import (
"context"
)
// Key生成错误信息
type LangError interface {
Error() string // 实现error接口&获取翻译后的错误信息
GetCode() int // 获取翻译后的Code
@@ -12,6 +14,8 @@ type LangError interface {
SetLang(lang string) // 设置语言
}
type langError struct {
ctx context.Context
key string