上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页
  2022年12月10日
摘要: 基本的单例模式 之前总结过博客:https://www.cnblogs.com/paulwhw/p/15450657.html#_label2 看一下Once的源码 type Once struct { done uint32 m Mutex } func (o *Once) Do(f func() 阅读全文
posted @ 2022-12-10 13:12 江湖乄夜雨 阅读(184) 评论(0) 推荐(0)
  2022年12月6日
摘要: 不带超时的写法 package concurrent_test import ( "fmt" "math/rand" "sync" "testing" "time" ) func init() { rand.Seed(time.Now().UnixNano()) } // 使用channel控制并发 阅读全文
posted @ 2022-12-06 16:46 江湖乄夜雨 阅读(234) 评论(0) 推荐(0)
  2022年12月2日
摘要: package gorm_tests import ( "fmt" "github.com/fatih/structs" "github.com/go-playground/validator/v10" "github.com/stretchr/testify/require" "gorm.io/d 阅读全文
posted @ 2022-12-02 19:55 江湖乄夜雨 阅读(1539) 评论(0) 推荐(0)
摘要: package scripts_stroage import ( "fmt" "github.com/go-playground/validator/v10" "testing" ) // 参考博客: // https://juejin.cn/post/6900375680358285325 // 阅读全文
posted @ 2022-12-02 15:56 江湖乄夜雨 阅读(240) 评论(0) 推荐(0)
  2022年11月5日
摘要: expr_basic_test package expr_practice import ( "errors" "fmt" "github.com/antonmedv/expr" "testing" "time" ) // https://github.com/antonmedv/expr // 优 阅读全文
posted @ 2022-11-05 19:37 江湖乄夜雨 阅读(1117) 评论(0) 推荐(0)
  2022年9月2日
摘要: package utils import ( "fmt" "github.com/shopspring/decimal" "math" "math/rand" "testing" "time" ) func init() { // 初始化rand模块的Seed,要不然所有的随机值会一样~ rand. 阅读全文
posted @ 2022-09-02 17:21 江湖乄夜雨 阅读(774) 评论(0) 推荐(0)
  2022年8月21日
摘要: package go_tests import ( "bytes" "fmt" "testing" ) // 值类型与引用类型 func TestT55(t *testing.T) { a := 123 b := a // 指向不同的内存地址 fmt.Printf("a: %d, %p \n", a 阅读全文
posted @ 2022-08-21 11:04 江湖乄夜雨 阅读(81) 评论(0) 推荐(0)
  2022年7月14日
摘要: AES加解密的类 python解释器用的是3.9,安装Crypto相关模块报错的解决方案:https://stackoverflow.com/questions/19623267/importerror-no-module-named-crypto-cipher import base64 from 阅读全文
posted @ 2022-07-14 11:51 江湖乄夜雨 阅读(795) 评论(0) 推荐(0)
  2022年6月27日
摘要: package random_string import ( "encoding/hex" "fmt" "math/rand" "testing" "time" ) // 长度为62 var bytes []byte = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcde 阅读全文
posted @ 2022-06-27 18:03 江湖乄夜雨 阅读(3392) 评论(0) 推荐(0)
摘要: 视频:https://www.bilibili.com/video/BV1mB4y1p79d/ 项目地址:https://gitee.com/huoyingwhw/request_ratelimit 阅读全文
posted @ 2022-06-27 18:02 江湖乄夜雨 阅读(222) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页