随笔分类 - golang
摘要:io.Reader 解析 - 简书 https://www.jianshu.com/p/03db37ca3249 简介 io.Reader 是一个 Interface 类型,功能非常强大,在任何需要读的地方我们都尽量使用它。先来看下它的原型: type Reader interface { Read
        阅读全文
                
摘要:1、 并发下载图片的goroutine数为CPU数加1 package goroutin import ( "fmt" "io" "net/http" "os" "sync" ) func dlImg(threadPool, batchNum int) { var wg sync.WaitGroup
        阅读全文
                
摘要:secguide/Go安全指南.md at main · Tencent/secguide · GitHub https://github.com/Tencent/secguide/blob/main/Go%E5%AE%89%E5%85%A8%E6%8C%87%E5%8D%97.md#119%E6%
        阅读全文
                
摘要:小结: 1) 使用defer延迟关闭channel secguide/Go安全指南.md at main · Tencent/secguide · GitHub https://github.com/Tencent/secguide/blob/main/Go%E5%AE%89%E5%85%A8%E6
        阅读全文
                
摘要:secguide/Go安全指南.md at main · Tencent/secguide · GitHub https://github.com/Tencent/secguide/blob/main/Go%E5%AE%89%E5%85%A8%E6%8C%87%E5%8D%97.md#112%E5%
        阅读全文
                
摘要:secguide/Go安全指南.md at main · Tencent/secguide · GitHub https://github.com/Tencent/secguide/blob/main/Go%E5%AE%89%E5%85%A8%E6%8C%87%E5%8D%97.md 1.1.3【必
        阅读全文
                
摘要:var AMap AMapS var once sync.Once func confCV(r *bizRepo) { // TODO once.Do(func() { b := r.data.confTODOBootstrap.DomainSonypathoid json.Unmarshal(b,
        阅读全文
                
摘要:场景 验证码 package base64Captcha // Store An object implementing Store interface can be registered with SetCustomStore // function to handle storage and r
        阅读全文
                
摘要:解析json、yaml文件 DsnDG : user:pwd@tcp(ip:portr)/db?charset=utf8mb4 type MysqlConfig struct { DsnDG string `yaml:"DsnDG"` } // config should be a pointer 
        阅读全文
                
摘要:IoWriter.go package main import ( "github.com/natefinch/lumberjack" "io" ) // github.com\natefinch\lumberjack@v2.0.0+incompatible\lumberjack.go type S
        阅读全文
                
摘要:use of internal package github.com/go-kratos/kratos/v2/internal/httputil not allowed
        阅读全文
                
摘要:Golang 并发编程指南 - 知乎 https://zhuanlan.zhihu.com/p/450822514 Golang 并发编程指南 腾讯技术工程  已认证账号 21 人赞同了该文章 作者:dcguo 分享 Golang 并发基础库,扩展以及三方库的一些常见问题、使用介绍和技巧,以及对一
        阅读全文
                
摘要:biz_grpc.pb.go // Code generated by protoc-gen-go-grpc. DO NOT EDIT. package v1 import ( context "context" grpc "google.golang.org/grpc" codes "google
        阅读全文
                
摘要:package syncimport ( "sync/atomic" "unsafe")// Cond implements a condition variable, a rendezvous point// for goroutines waiting for or announcing the
        阅读全文
                
摘要:一些连接池相关的总结 https://xargin.com/some-connection-pool/
        阅读全文
                
摘要:Go/src/builtin/builtin.go:52 // int64 is the set of all signed 64-bit integers.// Range: -9223372036854775808 through 9223372036854775807.type int64 i
        阅读全文
                
摘要:func main() { mutex := make(chan struct{}, 1) counter := 0 increase := func() { mutex <- struct{}{} counter++ <-mutex } increase1000 := func(done chan
        阅读全文
                
摘要:通道用例大全 - Go语言101(通俗版Go白皮书) https://gfw.go101.org/article/channel-use-cases.html 采用最快回应 本用例可以看作是上例中只使用一个通道变种的增强。 有时候,一份数据可能同时从多个数据源获取。这些数据源将返回相同的数据。 因为
        阅读全文
                
摘要:源码 kratos 配置热加载分析 github.com\go-kratos\kratos\v2@v2.1.2\config\value.go github.com/go-kratos/kratos/v2@v2.1.2/config/config.go:40 通过go程开启监听文件变动的功能 pac
        阅读全文
                
摘要:七牛云李意扬:如何收集 Go 实时覆盖率丨ECUG Meetup 回顾 https://mp.weixin.qq.com/s/aKI0NO4-WQwK0gxF7RDSnA 七牛云李意扬:如何收集 Go 实时覆盖率丨ECUG Meetup 回顾 原创 ECUG 活动组 七牛云技术团队 2021-12-
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号