摘要:
server.go: package main import ( "fmt" "log" "net/http" "os" "time" "github.com/gorilla/websocket" ) var port = ":1234" var upgrader = websocket.Upgra
阅读全文
posted @ 2024-06-13 21:29
ZhangZhihuiAAA
阅读(23)
推荐(0)
摘要:
package main import ( "context" "fmt" "os" "strconv" "time" "golang.org/x/sync/semaphore" ) func worker(n int) int { square := n * n time.Sleep(time.S
阅读全文
posted @ 2024-06-13 20:26
ZhangZhihuiAAA
阅读(32)
推荐(0)
摘要:
Reading from a closed channel returns the zero value of its data type. However, if you try to write to a closed channel, your program is going to cras
阅读全文
posted @ 2024-06-13 19:36
ZhangZhihuiAAA
阅读(19)
推荐(0)