GoCN 每日新闻 (2021-12-31)
- 快速了解 “小字端” 和 “大字端” 及 Go 语言中的使用https://developer.51cto.com/art/202112/697505.htm
- Golang 与非对称加密https://www.ssgeek.com/post/golang-yu-fei-dui-cheng-jia-mi
- 一文搞懂 Docker、Containerd、RunC 间的联系和区别https://mp.weixin.qq.com/s/kVh_EXGeMy_UI6qIgbmsGQ
- Golang 项目的配置管理——Viper 简易入门配置[https://www.cnblogs.com/Mrxuexi/p/15750455.html](https://www.cnblogs.com … ⌘ Read more
GoCN 每日新闻 (2022-01-13)
GoCN 每日新闻 (2022-01-13)
- Golang《基于 MIME 协议的邮件信息解析》部分实现https://gocn.vip/topics/20948
- 泛型可以拯救 Golang 笨拙的错误处理吗?https://blog.dnmfarrell.com/post/can-generics-rescue-golangs-clunky-error-handling/
- 更多的并行,并不等同更高的性能https://convey.earth/conversation?id=44
- 为什么 Go 有两种声明变量的方式,有什么区别,哪种好? [https://mp.weixin.qq.com/s/ADwEhSA1kFOFqzIyWvAqsA](https://mp.weixin.q … ⌘ Read more
Go 分布式令牌桶限流 + 兜底策略
上篇文章提到固定时间窗口限流无法处理突然请求洪峰情况,本文讲述的令牌桶线路算法则可以比较好的处理此场景。
- 单位时间按照一定速率匀速的生产 token 放入桶内,直到达到桶容量上限。
- 处理请求,每次尝试获取一个或多个令牌,如果拿到则处理请求,失败则拒绝请求。
优点
可以有效处理瞬间的突发流量,桶内存量 token 即可作为流量缓冲区平滑处理突发流量。
缺点
实现较为复杂。
代码实现core/limit/tokenlimit.go
分布式环境下考虑使用 redis 作为桶和令牌的存储容器,采用 lua 脚本实现整个算法流程。
redis lua 脚本
<span class="c1">-- 每秒生成token数量即token生成速度</span>
<span class="kd">local</span> <span class="n">rate</span> <span cl ... ⌘ [Read more](https://gocn.vip/topics/20950)
the repugnant conclusion turns around: “It’s too full here, let’s go home.”
a hedonium shockwave, a utility monster and the repugnant conclusion go into a bar.
GoCN 每日新闻(2022-01-12)
GoCN 每日新闻(2022-01-12)
- Go 实现的自动保存 Git 项目中未提交代码https://github.com/nikochiko/autosaved
- Go 中快速、简单的全栈 Web 开发入门工具包https://github.com/mikestefanello/pagoda
- Golang Redis RESP3 客户端,自动流水线并支持客户端缓存https://github.com/rueian/rueidis
- Runtime 不变性检查库[https:/ … ⌘ Read more
I feel like it took me a bit longer to fully understand how to work in Smalltalk than it did most languages. The IDE is different than anything I’ve used before, and probably anything you’ve seen as well. You’re not going to be opening myscript.st in your favorite text editor, and then run it from the command line as you would a Python program. It takes a little mental adjustment to start with.
That’s not the warning, howe … ⌘ Read more
GoCN 每日新闻 (2022-01-11)
GoCN 每日新闻 (2022-01-11)
- 解读 Go 语言的 2021:稳定为王https://mp.weixin.qq.com/s/9LKyPfhwldgZY7H4iS7sjg
- Go 泛型的 3 个核心设计https://mp.weixin.qq.com/s/I7qysvddG4NDgtYIMMAE3g
- Golang 的 Ealstic 链接库https://mp.weixin.qq.com/s/iHIxsEZf3w06GbO2sHSuRA
- 动态调整 GOGC 优化 Go 的 GC 标记 CPU 占� … ⌘ Read more
Go 中实现用户的每日限额(比如一天只能领三次福利)
如果你写一个 bug 管理系统,用了这个
PeriodLimit
你就可以限制每个测试人员每天只能给你提一个 bug。工作是不是就轻松很多了?:P
如今微服务架构大行其道本质原因是因为要降低系统的整体复杂度,将系统风险均摊到子系统从而最大化保证系统的稳定性,通过领域划分拆成不同的子系统后各个子系统能独立的开发、测试、发布,研发节奏和效率�� … ⌘ Read more
Go 模糊测试
- 原文地址: https://tip.golang.org/doc/fuzz/
- 原文作者:Go Team
- 本文永久链接:https:/github.com/gocn/translator/blob/master/2022/w01_Go_Fuzzing.md
- 译者: fivezh
- 校对: zxmfke
从 Go 1.18 版本开始,标准工具集开始支持模糊测试。
概述模糊测试(Fuzzing)是一种自动化测试方法,通过不断地控制程序输入来发现程序错误�� … ⌘ Read more
Go 实战 | 基于有向无环图的并发执行流的实现
大家好,我是「Go 学堂」的渔夫子。今天跟大家聊聊基于有向无环图的工作流的实现。
原文链接: https://mp.weixin.qq.com/s/F5BbHeMP7gBZHjiUL0qeeQ
01 工作流(workflow)概述工作流,是对工作流程中的工作按一定的规则组织在一起并按其进行执行的一种模型。比如常见的行政系统中的加班申请、请假申请;工作流要解�� … ⌘ Read more
GoCN 每日新闻 (2022-01-10)
GoCN 每日新闻 (2022-01-10)- Minecraft 管理 K8S 集群https://eric-jadi.medium.com/minecraft-as-a-k8s-admin-tool-cf16f890de42
- go ebpf 管理包https://github.com/ehids/ebpfmanager
- Go 错误处理https://earthly.dev/blog/golang-errors/
- Go 中实现用户的每日限额(比如一天只能领三次福利) [https://jueji … ⌘ Read more
GoCN 每日新闻 (2022-01-09)
- 带你探究 Go 语言的 iotahttps://mp.weixin.qq.com/s/V5iJgcLhCYMZd5l8akfbVQ
- 项目实战:使用 Fiber + Gorm 构建 REST APIhttps://mp.weixin.qq.com/s/RqUOLP-OG_wOpCzxVTAl6w
- Effective Error Handling in Golanghttps://earthly.dev/blog/golang-errors/
- 为什么不在 golang 中构建一个 redis 客户端[https://mauricio.github.io/2022/0 … ⌘ Read more
GoCN 每日新闻 (2022-01-08)
- Go 1.17.6/1.16.13 版本发布https://groups.google.com/g/golang-announce/c/95ZD3rKn4DI/m/93cyN8F1BAAJ
- 高效的 Go 错误处理https://earthly.dev/blog/golang-errors/
- 从零实现一个 RedisClient 了解 Redis 协议https://mauricio.github.io/2022/01/07/redis-protocol.html
- Golang 简洁架构实战[https://zh … ⌘ Read more
GoCN 每日新闻 (2022-01-07)
GoCN 每日新闻 (2022-01-07)
- 用 golang 在 tor 网络上安全的私有部署共享文件服务https://github.com/R4yGM/garlicshare
- 一个极速的 golang 全栈 web 开发包https://github.com/mikestefanello/pagoda
- ch 一个 clickhouse 客户端,比 rust 和 c++ 的都快https://github.com/go-faster/ch
- 用 gosec 扫描 go 源码的漏洞[https://jcdan3.medium. … ⌘ Read more
GoCN 每日新闻 (2022-01-06)
- Golang profiler 笔记https://github.com/DataDog/go-profiler-notes/blob/main/README.md
- Bundling templates with embedhttps://osinet.fr/go/en/articles/bundling-templates-with-embed/
- Go 通过 Map/Filter/ForEach 等流式 API 高效处理数据https://gocn.vip/topics/20922
- 滴滴夜莺监控发布 v5 正式版,定位 Promet … ⌘ Read more
GoCN 每日新闻 (2022-01-05)
GoCN 每日新闻 (2022-01-05)- Rust 与 Go: 为何相得益彰https://gocn.vip/topics/20929
- 聊聊 GOLANG 中形形色色的同步原语http://vearne.cc/archives/39631
- Go 泛型的这 3 个核心设计,你都知道吗?https://segmentfault.com/a/1190000041227815
- Go 语言高效率 Web 开发四:分层领域模型和项目结构分层[https://juejin.cn/post/70492 … ⌘ Read more
Rust 与 Go: 为何相得益彰
Rust 与 Go: 为何相得益彰- 原文地址: https://thenewstack.io/rust-vs-go-why-theyre-better-together/
- 原文作者: Jonathan Turner and Steve Francia
- 本文永久链接:https:/github.com/gocn/translator/blob/master/2021/w52_rust_vs_go_why_there_are_better_together.md.md
- 译者: [xkkhy](https:/gith … ⌘ Read more
Dumpling 导出表内并发优化丨 TiDB 工具分享
前言李淳竹(lichunzhu),TiDB 研发工程师
SIG 组:Migrate SIG Community,主要涵盖 TiDB 数据处理工具,包含 TiDB 数据备份/导入导出,TiDB 数据变更捕获,其他数据库数据迁移至 TiDB 等
Dumpling 是由 Go 语言编写的用于对数据库进行数据导出的工具。目前支持 MySQL 协议的数据库,并且针对 TiDB 的特性进行了优化。 [Go Dumpling! 让�� … ⌘ Read more
GoCN 每日新闻(2022-01-04)
GoCN 每日新闻(2022-01-04)- 「GoCN 酷 Go 推荐」go 语言位操作库 — bitsethttps://mp.weixin.qq.com/s/UcuKgKnt4fwrg3c-UHc3sw
- Go 通过 Map/Filter/ForEach 等流式 API 高效处理数据https://mp.weixin.qq.com/s/7ATm_Zu7ib9MXf8ugy3RcA
- 优化 Go 二进制文件的大小[https://prog.world/optimizing-the-size-of-the-go-binary](https://prog.world/optimizing-the-si … ⌘ Read more
What’s new in dubbo-go-pixiu 0.4.0
Dubbo-go-pixiu 是一款高性能 API 网关,支持 Dubbo 和 Http 等多种协议。具体介绍文章可以参考 《Dubbo 跨语言调用神兽:dubbo-go-pixiu》。
近期社区发布了 0.4.0 版本,具体请查看 v0.4.0。相关改进实在太多,本文只列出相关重大 feature、bugfix 、 性能提升项。
1 动态从 Spring Cloud 和 Dubbo 注册中心拉取路由和集群配置数据Pixiu 原本依赖本� … ⌘ Read more
Go 通过 Map/Filter/ForEach 等流式 API 高效处理数据
什么是流处理如果有 java 使用经验的同学一定会对 java8 的 Stream 赞不绝口,极大的提高了们对于集合类型数据的处理能力。
”`
int sum = widgets.stream()
<span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class= ... ⌘ [Read more](https://gocn.vip/topics/20922)```
GinAdmin 后台管理模板
GinAdmin这个项目是以 Gin 框架为基础搭建的后台管理平台,虽然很多人都认为 go 是用来开发高性能服务端项目的,但是也难免有要做 web 管理端的需求,总不能再使用别的语言来开发吧。所以整合出了 GinAdmin 项目,请大家多提意见指正!欢迎 star ⭐⭐
依赖- golang > 1.8
- Gin
- BootStrap
- LayUi
- WebUpload
- [Light Year Admin Using Ifra … ⌘ Read more
Excelize 发布 2.5.0 版本,Go 语言 Excel 文档基础库
Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片 … ⌘ Read more
go 语言位操作库 bitset
bitset库
实现了 bitsets
数据结构,这是一种正整数和布尔值映射关系的结构,它比 map[uint]bool
更高效
bitsets 基本思想是用一个 bit 位来标记某个元素对应的 Value,每一位表示一个数,1 表示存在,0 表示不存在
比如我要表示 1, 3, 7 这 3 个数
- 构造一个空白 bitsets:00000000
- 每位代表的值如下:76543210
- 想要表示的值标记 1:10001010
�� … ⌘ Read more
GoCN 每日新闻 (2022-1-1)
- https://eli.thegreenplace.net/2021/go-https-servers-with-tls/ Go HTTPS servers with TLS
- https://eli.thegreenplace.net/2020/embedding-in-go-part-3-interfaces-in-structs/ interfaces in structs
- https://mp.weixin.qq.com/s/Ec1nuR5Q_QgaC3FqeX1gLg 最简单的服务响应时长优化方法
- [https: … ⌘ Read more
I just went to type the phrase “I avoid Linux like the plague” but then remembered that we’ve all learned that most people won’t actually go much out of their way to avoid the plague.
GoCN 每日新闻 (2021-12-30)
GoCN 每日新闻 (2021-12-30)
- 如何在 Go 中将 [] byte 转换为 io.Reader?https://mp.weixin.qq.com/s/nFkob92GOs6Gp75pxA5wCQ
- 彻底搞懂 Kubernetes 中的 Eventshttps://mp.weixin.qq.com/s/QRIck4M1-CJVrVDoJEsjQA
- 对比 Rust 和 Go 对二进制数据处理[https://medium.com/@protiumx/advent-of-code-rust-go-and-binary-operators-7dd03057c134](https://medium.com/@protiumx/advent-o … ⌘ Read more
GoCN 每日新闻(2021-12-29)
GoCN 每日新闻(2021-12-29)
- 用 Go 实现向手机推送工具https://github.com/binwiederhier/ntfy
- 基于 Go 实现 Mumble 和 Discord 之间的语音工具https://github.com/Stieneee/mumble-discord-bridge
- Go 中这么多创建 error 的方式,你真的了解它们各自的应用场景吗https://gocn.vip/topics/20911
- Go 依赖分析工具包[http … ⌘ Read more
rewrite of getwtxt (as getwtxt-ng) is going okay. i’m much happier with sqlite for storage.
[深圳] 百度 BFE 项目招聘 Go 研发工程师
团队简介百度智能负载均衡团队负责维护 BFE 开源项目,并研发负载均衡商业产品。
BFE 是基于 Go 语言的七层负载均衡系统,已经在百度内经过多年的研发,每天转发万亿级的请求。BFE 于 2019 年 7 月开源,2020 年 6 月成为 CNCF 官方项目。
除百度以外,BFE 已经被 360、用友网络、招商银行、央视网等公司或机构使用。
BFE 开源项目地址:
Go 中这么多创建 error 的方式,你真的了解它们各自的应用场景吗
大家好,我是渔夫子。今天从应用场景的角度来聊聊我对 error 的理解。
原文链接: https://mp.weixin.qq.com/s/ncEemMJ0kQayVPJrnF9aew
01 什么是 Error在 Go 中,error 是一种内建的数据类型。在 Go 中被定义为一个接口,定义如下:
<span class="c">// The error built-in interface type is the conventional interface for< ... ⌘ [Read more](https://gocn.vip/topics/20911)
GoCN 每日新闻 (2021-12-28)
GoCN 每日新闻 (2021-12-28)
- 使用 Go SDK 与 OCI 对象存储交互https://lucasjellema.medium.com/interacting-with-oci-object-storage-using-go-sdk-first-steps-f50682418488
- 深入理解 Go Json.Unmarshal 精度丢失之谜https://mp.weixin.qq.com/s/36CqC1U54LUd4-izt4iZ1g
- 基于 OpenTelemetry 和 ClickHouse 的分布式链路 … ⌘ Read more
Trying to get down to Reading List Zero before I need to go back to work next year. The latest to be removed from the list because I read the thing: https://ngnghm.github.io/
GoCN 每日新闻(2021-12-27)
GoCN 每日新闻(2021-12-27)
- ApacheCN Golang 译文集https://github.com/apachecn/apachecn-golang-zh
- Dubbo-go v3.0 正式发布 ——打造国内一流开源 Go 服务框架https://developer.aliyun.com/article/839884
- Go Quiz: 从 Go 面试题看 slice 的底层原理和注意事项https://juejin.cn/post/7045953087080497166
- 为什么 … ⌘ Read more
梦想总是要有的 - 工作 20 年程序员的 2021 年度总结
跌宕起伏的 2021 年快要过去了,今年对我来说经历的实在太多,提笔做个简单的总结吧。
去年的年终总结,我给自己立了两个 flag。
第一个虽然不可量化,不是一个好的目标,但我认为完成的还是不错的,go-zero 的工程效率已经得到了社区的广泛认可,感谢所有使用和� … ⌘ Read more
GoCN 每日新闻 (2021-12-26)
- Go 泛型的 facilitator 模式https://rakyll.org/generics-facilititators
- Go 1.18 泛型: 好的、坏的、丑的https://itnext.io/golang-1-18-generics-the-good-the-bad-the-ugly-5e9fa2520e76
- Go 调试器发布 Delve 1.8.0 版本,支持 1.18 泛型调试https://github.com/go-delve/delve/releases/tag/v1.8.0
4 … ⌘ Read more
GoCN 每日新闻(2021-12-25)
- Python 在 Go 中的双向嵌入https://github.com/tliron/py4go
- golang 实的 xmpp 服务 jackal v0.55.0https://github.com/ortuman/jackal
- Go 有哪几种无法恢复的致命场景? https://mp.weixin.qq.com/s/gSfzrSKYbZTP8COz4lZKHQ
- 必看!6 步入门 Gohttps://mp.weixin.qq.com/s/DRpmh41dGAfzSOMsvwy8wA
- … ⌘ Read more
GoCN 每日新闻 (2021-12-24)
GoCN 每日新闻 (2021-12-24)
- ccgo 更新添加 macOS clang 支持https://pkg.go.dev/modernc.org/ccgo/v3
- 一个简单强大的 SSH 秘钥管理器https://golangexample.com/skm-a-simple-and-powerful-ssh-keys-manager/
- golang 会缓存 dns 吗[https://www.reddit.com/r/golang/comments/rn9b6d/is_golang_caching_dns/](https://www.reddit.com/r/golang/comments/rn9b6d/is_golang_ca … ⌘ Read more
GoCN 每日新闻(2021-12-23)
- 《真·简单》Golang 轻量级桌面程序 wails 库(圣诞节限定) https://gocn.vip/topics/20899
- Go 实战 | 一文带你搞懂从单队列到优先级队列的实现https://gocn.vip/topics/20897
- 什么时候在 Go 中使用泛型https://teivah.medium.com/when-to-use-generics-in-go-36d49c1aeda
- 深入研究 NSO 零点击 iMessage 漏洞:远� … ⌘ Read more
《真·简单》Golang 轻量级桌面程序 wails 库(圣诞节限定)
Golang 轻量级桌面程序 wails2 教学 推荐理由不依赖 cgo! 不依赖 cgo! 不依赖 cgo!真的不依赖 cgo,且跨平台,原生渲染 无嵌入式浏览器,轻量级,生成的文件很小,而且只有一个可执行文件就可运行。
功能介绍- 后端使用标准 Go
- 使用任意前端技术构建 UI 界面
- 快速为您的 Go 应用生成 Vue、Vuetify、React 前端代码
- 通过简 … ⌘ Read more
Go 实战 | 一文带你搞懂从单队列到优先级队列的实现
原文链接: https://mp.weixin.qq.com/s/bPLRcsmSO5_MvqN8F812zQ
大家好,我是「Go 学堂」的渔夫子,今天跟大家聊聊在我们项目中的优先级队列的实现及应用场景。
优先级队列概述队列,是数据结构中实现先进先出策略的一种数据结构。而优先队列则是带有优先级的队列,即先按优先级分类,然后相同优先级的再 … ⌘ Read more
Hey @eldersnake@yarn.andrewjvpowell.com I just came across this cool little project recently. Not written by me sadly 😂 But seems like it would do the trick nonetheless 🤣 – How are you going with PageKite? Is it still working okay for your Yarn pod powered by the outback of down under? 😅 LMK if you’d like me to spin this up anad you can be my first tester 🤙
GoCN 每日新闻(2021-12-22)
GoCN 每日新闻(2021-12-22)- 使用 Go 和 SQLite 构建生产应用程序
- 使用 context.Context 模拟 API 客户端https://incident.io/blog/golang-client-mocks
- 一种可嵌入的 Go 脚本语言,实现了逻辑编程语言 Prologhttps://github.com/ichiban/prolog
- SSA:终于知道编译器偷摸做了哪些事[https://mp.weixin.qq.com/s/nOhMsMeP1pUFEXKAMUzbWg](https://mp.weixin.qq.com/ … ⌘ Read more
GoCN 每日新闻(2021-12-20)
GoCN 每日新闻(2021-12-20)
- Golang 并发编程指南https://mp.weixin.qq.com/s/V0krCjWrndzz71cVOPBxdg
- Visualizing Concurrency in Gohttps://divan.dev/posts/go_concurrency_visualize/
- 深入剖析全链路灰度技术内幕https://mp.weixin.qq.com/s/JklS0ZBNRCEBvLWUOo-UrQ
- GoLand 2021.3.1 Is Out; but the content this guy produces is awesome! 👌
Scotty from marketing really needs to be fired! Can we even fire Prime Ministers besides calling an election? 🤔 The more you dig into our #Australian #Government the more you realize just how fucking corrupt they all are and have been over so many years. How?! 🤦
@prologic@twtxt.net I think this is awesome. I’m proud to be part of this.
Annnd… I need to learn go. No money here, but at least I would make some cool PRs (or MRs?)
GoCN 每日新闻(2021-12-19)
GoCN 每日新闻(2021-12-19)- Go 官方出品泛型教程:如何开始使用泛型https://gocn.vip/topics/20885
- 有了 sync 为什么还有 atomic? https://mp.weixin.qq.com/s/YIIQODPJmZRrrX4hvGEwXg
- Golang 并发编程指南https://mp.weixin.qq.com/s/V0krCjWrndzz71cVOPBxdg
- LeetCode 第 272 场周赛题解 (Golang)[https://juejin.cn/p … ⌘ Read more
教程:如何开始使用泛型
教程:如何开始使用泛型- 原文地址: https://go.dev/doc/tutorial/generics
- 原文作者:go.dev
- 本文永久链接: https://github.com/gocn/translator/blob/master/2021/w49_Tutorial_Getting_started_with_generics.md
- 译者: zxmfke
- 校对: cvley
目�� … ⌘ Read more
GoCN 每日新闻 (2021-12-18)
GoCN 每日新闻(2021-12-17)
GoCN 每日新闻(2021-12-17)- Golang 与散列算法https://www.ssgeek.com/post/golang-yu-san-lie-suan-fa
- Golang 跟 Python3 的区别对比有哪些?https://juejin.cn/post/7042211939795075103
- Golang、Gin 和 React、esbuild 开发的 Bloghttps://zhuanlan.zhihu.com/p/445749990
- 如何使用 Go 从 HTML 生成 PDF 报告[https:// … ⌘ Read more
@fastidious@arrakis.netbros.com the things Gemini has going for it are mutual TLS and lack of JavaScript. Which makes for a secure albeit boring experience (much like gopher). The fake markdown is a bit of a drag.
A render mode for Gemini probably wouldnt be too hard. There are markdown to Gemini libs out there.
With Web3 the whole trust a 3rd party browser ext + high fees + env impact for compute and storage are serious no gos for me.. I have heard one too many horror stories about clicking the wrong link and some script draining your metamask wallet.
GoCN 每日新闻 (2021-12-16)
GoCN 每日新闻 (2021-12-16)
Go1.18 泛型初体验https://gocn.vip/topics/20855
Ingress API 的增强属性https://github.com/ksrichard/easyraft
使用 eBPF 代替 iptables 优化服务网格数据面性能https://mp.weixin.qq.com/s/r7Yomt1u_EWrngAEPiBJiA
Go Modules 的前世今生与基本使用[https://mp.weixin.qq.com/s/mTQbKcNFXu7Fqcr5SDX2qA](http … ⌘ Read more
go 1.18 泛型初体验
go 1.18 泛型初体验go.1.18beta 版发布,众所周知这个 go.1.18 版本会默认启用 go 泛型。这个版本也号称 go 最大的版本改动。
初识 golang 的泛型我们写一个 demo 来看看 go 的泛型是长啥样
”`
package main
import (
<span class="s">"fmt"</span>
)
type OrderTypesRead more”`
漏桶限流库 — uber-go/ratelimit
编辑推荐:Bazinga
上次有同学分享了 单机限流器 time/rate 库,讲了 Golang 标准库中基于令牌桶实现限流组件的 time/rate
使用,同时也讲了一些限流算法原理。
这里分享一个 uber 开源的一套基于漏桶实现的用于服务限流的 golang 库 ratelimit。
漏洞算法的理解起来,相较于令牌桶,没有那么直观。因为令牌桶是限�� … ⌘ Read more
GoCN 每日新闻(2021-12-15)
GoCN 每日新闻(2021-12-15)
- Go 1.18beta1https://go.dev/blog/go1.18beta1
- Go 中易于使用的 Raft 库,使您的应用程序具有分布式、高可用性和容错性https://github.com/ksrichard/easyraft
- Go 实现的开源的、不可变的数据库 immudbhttps://github.com/codenotary/immudb/tree/v1.2.1
- Rust vs Go:你应该知道的 8 大核心 … ⌘ Read more
Notifications
⌘ Read more
GoCN 每日新闻(2021-12-14)
GoCN 每日新闻(2021-12-14)
- 发生即看见,一切可回溯,TiDB Continuous Profiling 应用实践https://mp.weixin.qq.com/s/61OVu5B9nzCqI-z65NYjRQ
- 直播流媒体网络传输服务https://github.com/q191201771/lal
- 基于寄存器调用的软件加速https://gocn.vip/topics/20835
- Go Ballast 让内存控制更加丝滑[https://gocn.vip/topics/17480]( … ⌘ Read more
Go 快速指南:go1.18 特性
- 原文地址: https://medium.com/@emreodabas_20110/quick-guide-go-1-18-features-e236d5b351ef
- 原文作者:Emre Odabas
- 本文永久链接: https://github.com/gocn/translator/blob/master/2021/w48_quick_guide_go1.18_features.md
- 译者: cuua
- 校对: [zxmfke](http://github.com/z … ⌘ Read more
用 Go + Redis 实现分布式锁
为什么需要分布式锁- 用户下单
锁住 uid,防止重复下单。
- 库存扣减
锁住库存,防止超卖。
- 余额扣减
锁住账户,防止并发操作。
分布式系统中共享同一个资源时往往需要分布式锁来保证变更资源一致性。
- 排他性
锁的基本特性,并且只能被第一个持有者持有。
- 防死锁
高并发场景下临界 … ⌘ Read more
Go 服务通信工具 Kun
Go 服务通信工具 Kun ⌘ Read more
What’s new from GitHub Changelog? November 2021 recap
We shipped a ton of updates in November, from the push notification for PR review activities on the go, to an easy way to create Markdown links. ⌘ Read more
GoCN 每日新闻(2021-12-13)
GoCN 每日新闻(2021-12-13)
- 尝鲜 Go 1.18 范型版本的 map 和 slice!https://juejin.cn/post/7040800455349239822
- Go 实现可序列化的 Roaring Bitmapshttps://dgraph.io/blog/post/serialized-roaring-bitmaps-golang/
- Go 使用 Github Actions 做 CI[https://www.alexedwards.net/blog/ci-with-go-and-github-actions](https://www.alexedwards.net/blog/ci-with-go-and-github … ⌘ Read more
BigCache 针对 Go 垃圾回收的设计优化
为什么有这篇文章某一天在群里摸鱼的时候,看到群里有人问 go map
的空间回收问题,把截图贴上吧:
其实一位群友发出的问题引起了我注意,他的问题是: go
的 map
的值调用了 delete
函数是不是不会立即删除?当然这个问题如果研究过或者深入 go
的内存分� … ⌘ Read more
高性能中文分词库 gojieba
gojieba 是什么?gojieba
是 Python 知名分词库结巴 jieba
的 Go 语言实现版本,底层分词算法由 C++ 实现,具备很高的性能; gojieba
解决了在做文本分析,文本搜索相关业务功能时的分词需求。
gojieba
支持多种分词方式:
- 全模式:把文本中所有可能的� … ⌘ Read more
fake english word generation for Go and CLI: [[https://github.com/nwtgck/go-fakelish]] #links
Apache Log4j 2 CVE-2021-44228
We know that many of you are working hard on fixing the new and serious Log4j 2 vulnerability CVE-2021-44228, which has a 10.0 CVSS score. We send our #hugops and best wishes to all of you working on this vulnerability, now going by the name Log4Shell. This vulnerability in Log4j 2, a very common Java […]
The post Apache Log4j 2 CVE-2021-44228 appeared first on Docker Blog. ⌘ Read more
GoCN 每日新闻 (2021-12-11)
- 快速搭建私有云服务 go-btfshttps://gocn.vip/topics/20839
- 基于寄存器调用的软件加速https://gocn.vip/topics/20835
- 详解布隆过滤器的原理和实现https://gocn.vip/topics/20832
- 动手实现一个 localcachehttps://mp.weixin.qq.com/s/ZtSA3J8HK4QarhrJwBQtXw
- Go:不用标准库如何解压 zip 文件?[https://m … ⌘ Read more
快速搭建私有云服务 go-btfs
快速搭建私有云服务 go-btfs 1. go-btfs 是什么?go-btfs go-btfs 是一个去中心化的文件存储平台,无论图片、文件、视频等等各类文件。
每个人都可以在自己电脑上安装部署 BTFS 节点,然后大家的节点相互连接,构成一个整体网络,
网络中某一个节点上传文件,其他节点就像访问本地一样直接下载使用。同时,它还支持冗余备份,使用 reed-solomn … ⌘ Read more
【上海】【米哈游】Golang 研发工程师
职位描述:
1、负责米哈游游戏的官网、活动的开发;
2、负责线上活动和游戏工具的维护和迭代;
3、归纳和封装活动的通用组件和基础服务;
岗位要求:
1、计算机相关专业本科及以上学历,有两年以上后台开发经验;
2、熟悉 Go 语言,有实际使用 Go 语言项目开发经验;
3、对微服务架构有一定程度的研究并有开发经验,在服务治理,服务监 … ⌘ Read more
GoCN 每日新闻 (2021-12-10)
GoCN 每日新闻 (2021-12-10)
- bob 一个从天上掉下来的构建工具https://github.com/benchkram/bob
- hackgo 编译器让 go 添加一个新的关键字https://avi.im/blag/2021/rc-day-24/
- 一个” 自由 “解析 xml 而不是预定义 struct 的工具https://github.com/xrfang/fxml
- 一个真开源的 mongodb 的替代者[https://github.com/FerretDB/FerretDB](https://gi … ⌘ Read more
@lyse@lyse.isobeef.org more often than not, it is! I mean, I try to go over the changes, but soon find myself in a web (not pun!), all entangled. Then say, “screw it!” and to the bin it goes. 🥴
GoCN 每日新闻 (2021-12-09)
GoCN 每日新闻 (2021-12-09)- Hugo v0.90.0 发布https://github.com/gohugoio/hugo/releases/tag/v0.90.0
- Docker 容器中使用 GPUhttps://segmentfault.com/a/1190000041090167
- 我好像发现了一个 Go 的 Bug? https://www.cnblogs.com/zhuochongdashi/p/15660936.html
- Go modules 基础精进,六大核心概念全解析� … ⌘ Read more
GoCN 每日新闻(2021-12-07)
- 带你重走 TiDB TPS 提升 1000 倍的性能优化之旅https://gocn.vip/topics/20825
- Go 不需要 Java 风格的 GChttps://itnext.io/go-does-not-need-a-java-style-gc-ac99b8d26c60
- 聊聊 TokenBucket 限流器的基本原理及实现https://gocn.vip/topics/20824
- Go - 如何编写 ProtoBuf 插件 (一)[https://mp.weixin.qq.com/s/yeqeMNsD0W1aOzK7RZcSIw](h … ⌘ Read more
聊聊 TokenBucket 限流器的基本原理及实现
限流器实现之 TokenBucket大家好,我是「Go 学堂」的渔夫子。上篇文章我们讲解了漏桶(LeakyBucket)的实现原理。本文我们介绍另外一种限流器 — 令牌桶(TokenBucket)。
令牌桶(TokenBucket)简介 令牌桶实现的基本思想令牌桶,顾名思�� … ⌘ Read more
GoCN 每日新闻(2021-12-05)
GoCN 每日新闻(2021-12-05)- Go 在 Google:服务于软件工程的语言设计(翻译) https://mp.weixin.qq.com/s/3F9WAcxuCNCs7aNn5gjnew
- 详解布隆过滤器原理与实现https://mp.weixin.qq.com/s/5zHQbDs978OoA3g83NaVmw
- 令人惊叹的软件架构[https://github.com/mehdihadeli/awesome-software-architecture](https://github.com/mehdihadeli/awesome-software-archite … ⌘ Read more
GoCN 每日新闻 (2021-12-04)
- https://mp.weixin.qq.com/s/O-6FdYn2l8hxOfGUUz9CHg grpc context
- https://mp.weixin.qq.com/s/qvXr7300EX7HrB4KlspPGQ 蚂蚁集团大规模 Sigma 集群 ApiServer 优化实践
- https://mp.weixin.qq.com/s/qaDfrlc1UR8_q6SGGaGB0Q Go 操作 Kafka 如何保证无消息丢失
- [https://mp.weixin.qq.com/s/T5Kc8vETz7Dmp0KVQP7YNg](https://mp.weix … ⌘ Read more
更严格的代码格式化工具 gofumpt
前言gofmt
是 golang 自带的代码自动格式化工具,是保证 Go 代码风格一致的大杀器。我们这次要推荐的 gofumpt
在 gofmt
的基础上添加了一系列更加严格的格式化规则,并保证了对 gofmt
的兼容。
gofumpt
有助于进一步提升代码质量,它已经成为 gopls
(Go 官方语言服务)中可选的格式化工具以及 golangci-lint
中支持的 linter,正在被越来越多优秀的开源项目(sourcegraph� … ⌘ Read more
Underscores in Imports
Underscores in Imports Underscores in Go serve a few purposes. In U+005F, “_” is a letter (as a string). You may also see them as [ “_” ] in between successive digits and a base prefix. In this case, it’s to improve the readability of the code. You may also see them in function names, e.g., imaginary_lit.
The underscore is quite a versatile tool. They even have their place in defining the kind of action that will take place in a function. ⌘ Read more
Powering Starlink on the go with Tesla Model 3
I’ve had my Tesla Model 3 for more than a year now. It has been an
absolute pleasure so far and I would not trade it for anything else at
any price including Tesla’s other offerings (yes, talking about S
Plaid). Model 3 just has the most beautiful exterior of any other car.
OK, let’s stop here because I can go on forever. But not without a photo
of Tin Can:
“Tin Can” is a r … ⌘ Read more
DS9 is best Star Trek. And that last second half of the last season where they go all out. chef kiss
No on gitlab. If its self hosted gitea is best in class.
I can see hosting a mirror on github if only for the redundancy/visibility. Some projects will host but then direct contributions on their self host. Like Go does.
I would suggest using a vanity domain that can redirect tools like go get to hosting of choice. And not require rewriting all the packages any time it gets moved.
JavaScript : web apps
wut?! 😳 seriously?! 🤦♂️
Python : small tools
Okay 👌
Go: micro services
Umm bad generalization 🤣 – Example yarnd
that powers most of Yarn.social 😂
Java: enterprise software
Yes! Oh gawd yes! 🤣 And Java™ needs to die a swift death!
C: crimes
Hmmm? 🤔 I feel this one is going to have some backslash and/or go the way of “Hacker” being misconstrued to mean entirely different/incorrect things as is what’s happening in the media (for various definitions of “media”).
Yep! https://git.mills.io/yarnsocial/yarn/src/branch/master/internal/webmention/webmention.go#L150-L156
New theme for yarn is up now at: https://git.mills.io/sorenpeter/darchTheme
Still needs some work, but please have a go with it and hack away
Struct Tags with Underscore Before Function Names
In the Go world, an underscore (_) before an expression is called a blank identifier. As you may already know, identifiers—user-defined program components, e.g., name of a function, variable, or package—in Go must be preceded by an underscore or a letter (a-z or A-Z). If they aren’t, you’ll receive the compile- time error which essentially means Go cannot read the syntax of your code (you didn’t write your code correctly … ⌘ Read more
The best part of Pokémon Go is hatching eggs. I just wish I could queue up eggs for the incubators so I didn’t have to check my phone every now and again. Actually, I wish there was a game where you just hatched eggs.
Wirecutter
⌘ Read more
Screaming In the Cloud with Corey Quinn and Docker CEO Scott Johnston
On August 31st, Docker announced updates to our product subscriptions — Docker Personal, Pro, Team and Business. Our CEO Scott Johnston recently joined Corey Quinn on an episode of Screaming in the Cloud to go over all the details and discuss how the changes have been received by businesses and the broader developer community. The […]
The post [Screaming In the Cloud with Corey Quinn and … ⌘ Read more
Now, onto the real question: what to eat? Partner isn’t home, so zero nutritional supplements have been consumed, and I have been lazy enough not to go out to fetch me something. So… hmm, yeah. Going to an eight years old niece birthday “roller scatting” party in an hour, maybe I get lucky with a slice of pizza, or two. 🤣
@movq@www.uninformativ.de
Aha! Cool! Not just deleting, but proceeding as if the twt is going to be send. If I :q!
on vi it will add an empty line. If, instead, I go :x
like I normally do, it works as you said—and as I wanted it. Thanks!
Is it me, or Gmail’s web interface is going down the drain? Using Safari—my default browser—often takes two, or three clicks to open an email. If it weren’t because its search is amazing, I would never visit its web interface.