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