01 2024 档案

摘要:首先需要在项目依赖Cargo.toml添加lazy_static依赖项 [dependencies] lazy_static = "1.4.0" 示例代码如下: use lazy_static::lazy_static; use std::sync::{RwLock, RwLockReadGuard 阅读全文
posted @ 2024-01-25 11:41 ALXPS 阅读(346) 评论(0) 推荐(0) 编辑
摘要:go中对通道chan遍历有两种方式一种是用range另一种为for select。 package main import ( "fmt" "strings" ) func main() { intChan0 := make(chan int, 10) for i := 0; i < 10; i++ 阅读全文
posted @ 2024-01-23 17:02 ALXPS 阅读(139) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示