feat(auth): 添加完整的用户认证API项目
- 实现用户注册、登录、JWT令牌认证功能 - 集成Gin、GORM、Viper、Zap等框架 - 添加密码加密、数据库操作、中间件等完整功能 - 配置多环境支持、日志轮转、CORS处理 - 创建完整的项目结构和配置文件体系
This commit is contained in:
16
go并发模型/06go-atomic-cpu/atomic_cas.go
Normal file
16
go并发模型/06go-atomic-cpu/atomic_cas.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var value int64 = 0
|
||||
|
||||
success := atomic.CompareAndSwapInt64(&value, 0, 42)
|
||||
fmt.Println("第一次 CAS 是否成功:", success, "当前值:", value)
|
||||
|
||||
success = atomic.CompareAndSwapInt64(&value, 0, 100)
|
||||
fmt.Println("第二次 CAS 是否成功:", success, "当前值:", value)
|
||||
}
|
||||
Reference in New Issue
Block a user