新Sir

导航

 

2024年10月25日

摘要: package main import ( "fmt" "sort" ) type data struct { Key string val int } func main() { m := make(map[string]int) m["aone"] = 1 m["tree"] = 3 m["bt 阅读全文
posted @ 2024-10-25 19:22 新Sir 阅读(40) 评论(0) 推荐(0)
 
摘要: package main import "fmt" func main() { ch := make(chan int, 2) ch <- 1 ch <- 2 close(ch) for i := 0; i < cap(ch)+1; i++ { // 从已关闭的通道中获取数据,去除的数据放在data 阅读全文
posted @ 2024-10-25 16:39 新Sir 阅读(32) 评论(0) 推荐(0)