i18n: Translate all Chinese to English across the codebase
Translate Chinese comments, log/error messages, validator labels and Swagger annotations to English throughout the source code, generated Swagger docs, config files and CI workflows. Make the English README primary: README.md now holds the English docs and README_EN.md holds the Chinese version, with cross-language links updated accordingly. Note: the generated docs/ swagger files were translated in place; run `go generate ./...` (swag init) to regenerate them from the now-English annotations when a Go toolchain is available. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Vendored
+14
-14
@@ -11,7 +11,7 @@ func TestMemorySet(t *testing.T) {
|
||||
err := mc.Set("123", "44567", 0)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
t.Fatalf("写入失败")
|
||||
t.Fatalf("write failed")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ func TestMemoryGet(t *testing.T) {
|
||||
err := mc.Get("123", &res)
|
||||
fmt.Println("res", res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败 " + err.Error())
|
||||
t.Fatalf("read failed " + err.Error())
|
||||
}
|
||||
if res != "44567" {
|
||||
t.Fatalf("读取错误")
|
||||
t.Fatalf("read error")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,30 +37,30 @@ func TestMemorySetExpGet(t *testing.T) {
|
||||
mc.Set("2", "5", 5)
|
||||
err := mc.Set("3", "3", 3)
|
||||
if err != nil {
|
||||
t.Fatalf("写入失败")
|
||||
t.Fatalf("write failed")
|
||||
}
|
||||
|
||||
res := ""
|
||||
err = mc.Get("3", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res 3", res)
|
||||
time.Sleep(4 * time.Second)
|
||||
//res = ""
|
||||
err = mc.Get("3", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res 3", res)
|
||||
err = mc.Get("2", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res 2", res)
|
||||
err = mc.Get("1", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res 1", res)
|
||||
|
||||
@@ -69,29 +69,29 @@ func TestMemoryLru(t *testing.T) {
|
||||
mc := NewMemoryCache(18)
|
||||
mc.Set("1", "1111", 10)
|
||||
mc.Set("2", "2222", 5)
|
||||
//读取一次,2就会被放到最后
|
||||
// read once, so 2 will be moved to the end
|
||||
mc.Get("1", nil)
|
||||
err := mc.Set("3", "三", 3)
|
||||
err := mc.Set("3", "three", 3)
|
||||
if err != nil {
|
||||
//t.Fatalf("写入失败")
|
||||
//t.Fatalf("write failed")
|
||||
}
|
||||
|
||||
res := ""
|
||||
err = mc.Get("3", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res3", res)
|
||||
res = ""
|
||||
err = mc.Get("2", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res2", res)
|
||||
res = ""
|
||||
err = mc.Get("1", &res)
|
||||
if err != nil {
|
||||
t.Fatalf("读取失败" + err.Error())
|
||||
t.Fatalf("read failed" + err.Error())
|
||||
}
|
||||
fmt.Println("res1", res)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user