feat(auth): 添加完整的用户认证API项目
- 实现用户注册、登录、JWT令牌认证功能 - 集成Gin、GORM、Viper、Zap等框架 - 添加密码加密、数据库操作、中间件等完整功能 - 配置多环境支持、日志轮转、CORS处理 - 创建完整的项目结构和配置文件体系
This commit is contained in:
23
go并发模型/06go-atomic-cpu/cpu_channel_wait.go
Normal file
23
go并发模型/06go-atomic-cpu/cpu_channel_wait.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
stop := make(chan struct{})
|
||||
|
||||
go func() {
|
||||
select {
|
||||
case <-stop:
|
||||
fmt.Println("worker 收到停止信号,退出")
|
||||
}
|
||||
}()
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
fmt.Println("main: 关闭 stop channel")
|
||||
close(stop)
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
Reference in New Issue
Block a user