refactor: 将端口和在线ID类型从uint16改为uint32
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-03-02 18:34:20 +08:00
committed by cnb
parent ae06d18aa2
commit 47bc680889
12 changed files with 35 additions and 35 deletions

View File

@@ -1,13 +1,13 @@
package cool
// 存值示例
func AddClient(id uint16, client *ClientHandler) {
func AddClient(id uint32, client *ClientHandler) {
// 普通mapClientmap[id] = client
Clientmap.Store(id, client) // sync.Map存值
}
// 取值示例
func GetClient(id uint16) (*ClientHandler, bool) {
func GetClient(id uint32) (*ClientHandler, bool) {
// 普通mapclient, ok := Clientmap[id]
val, ok := Clientmap.Load(id) // sync.Map取值
if !ok {