docs(comments): 注释中文化 · plugins/channels/weixin_ilink(20 文件,纯替换)
- 只翻注释/文档字符串:剥掉行尾注释后,每条「-」都有逐字节相同的「+」对应行(8 组,代码零改动) - 保留协议/线上标识符原文:errcode、bot_token、context_token、getupdates、binded_redirect、PKCS#7、ECB 等 - 术语对齐既有译法:owner→主人、peer→对端、long poll→长轮询、backoff→退避、sentinel error→哨兵错误 - 已知既有欠债(未顺手修):login_reuse_test.go 在 HEAD 上就未 gofmt 干净;login_test.go 的 TestStartLogin_ScanStatusTransition 91 行 >80(HEAD 同为 91 行)
This commit is contained in:
1 parent
09fba77f87
commit
95f97f5df3
20 files changed
+488
-590
No files matched your search
@@ -10,7 +10,7 @@ import (
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/channel/adapter"
|
||||
)
|
||||
|
||||
// msgCollector collects emitted messages under a mutex.
|
||||
// msgCollector 在互斥锁下收集已投递的消息。
|
||||
type msgCollector struct {
|
||||
mu sync.Mutex
|
||||
msgs []adapter.UnifiedMessage
|
||||
@@ -70,7 +70,7 @@ func TestReadMessages_LongPoll_CursorAndContextToken(t *testing.T) {
|
||||
}()
|
||||
|
||||
waitFor(t, func() bool { return col.count() >= 2 })
|
||||
// Ensure the second long poll has run so the cursor echo is observable.
|
||||
// 确保第二次长轮询已执行,使游标回传可被观测。
|
||||
waitFor(t, func() bool { return len(getupdatesReqs(rec)) >= 2 })
|
||||
cancel()
|
||||
waitDone(t, done)
|
||||
@@ -141,7 +141,7 @@ func assertCursorAndContext(t *testing.T, ad *Adapter, rec *reqRecorder) {
|
||||
}
|
||||
}
|
||||
|
||||
// waitDone waits for the read loop goroutine to exit or fails after a timeout.
|
||||
// waitDone 等待读循环 goroutine 退出,超时则让测试失败。
|
||||
func waitDone(t *testing.T, done <-chan struct{}) {
|
||||
t.Helper()
|
||||
select {
|
||||
@@ -263,7 +263,7 @@ func TestReadMessages_HandlerDelivery(t *testing.T) {
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer close(done)
|
||||
// emit is intentionally nil: the handler must receive the message.
|
||||
// emit 故意传 nil:消息必须由处理器接收。
|
||||
ad.ReadMessages(ctx, nil)
|
||||
}()
|
||||
waitFor(t, func() bool { return handlerCalls.count() >= 1 })
|
||||
|
||||
Reference in new issue
Block a user