|
| 1 | +# Go语言爱好者周刊:第 146 期 |
| 2 | + |
| 3 | +这里记录每周值得分享的 Go 语言相关内容,周日发布。本周刊开源(GitHub:[polaris1119/golangweekly](https://github.com/polaris1119/golangweekly)),欢迎投稿,推荐或自荐文章/软件/资源等,请[提交 issue](https://github.com/polaris1119/golangweekly/issues) 。 |
| 4 | + |
| 5 | +鉴于一些人可能没法坚持把英文文章看完,因此,周刊中会尽可能推荐优质的中文文章。优秀的英文文章,我们的 GCTT 组织会进行翻译。 |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +题图:Go 打字速度测试仪 |
| 10 | + |
| 11 | +## 刊首语 |
| 12 | + |
| 13 | +上期的题目主要考察数组的比较。 |
| 14 | + |
| 15 | +```go |
| 16 | +package main |
| 17 | + |
| 18 | +import "fmt" |
| 19 | + |
| 20 | +func main() { |
| 21 | + type pos [2]int |
| 22 | + a := pos{4, 5} |
| 23 | + b := pos{4, 5} |
| 24 | + fmt.Println(a == b) |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +A:true;B:false;C:编译错误 |
| 29 | + |
| 30 | +数组是值类型,长度相等,每个元素也相等,数组就相等。所以,正确答案是 A。该题正确率 45%,还是不高。 |
| 31 | + |
| 32 | +看本期的题目。以下代码输什么? |
| 33 | + |
| 34 | +```go |
| 35 | +package main |
| 36 | + |
| 37 | +import ( |
| 38 | + "fmt" |
| 39 | +) |
| 40 | + |
| 41 | +func main() { |
| 42 | + var nums1 []interface{} |
| 43 | + nums2 := []int{1, 3, 4} |
| 44 | + nums3 := append(nums1, nums2) |
| 45 | + fmt.Println(len(nums3)) |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +A:3;B:1;C:4;D:编译失败 |
| 50 | + |
| 51 | +## 资讯 |
| 52 | + |
| 53 | +1、[sonic 1.3 发布](https://github.com/bytedance/sonic) |
| 54 | + |
| 55 | +字节开源的高性能 json 编解码库。 |
| 56 | + |
| 57 | +2、[kratos 2.3 发布](https://github.com/go-kratos/kratos) |
| 58 | + |
| 59 | +B 站开源的 Go 微服务框架。 |
| 60 | + |
| 61 | +3、[immudb 1.3.0](https://github.com/codenotary/immudb/releases/tag/v1.3.0) |
| 62 | + |
| 63 | +用于系统和应用程序的轻量级高速不可变数据库。 |
| 64 | + |
| 65 | +4、[traefik 2.7.0 发布](https://github.com/traefik/traefik/releases/tag/v2.7.0) |
| 66 | + |
| 67 | +云原生应用代理。 |
| 68 | + |
| 69 | +5、[oak 4.0.0 发布](https://github.com/oakmound/oak/releases/tag/v4.0.0) |
| 70 | + |
| 71 | +2D 游戏引擎。 |
| 72 | + |
| 73 | +6、[fiber 2.34.0 发布](https://github.com/gofiber/fiber/releases/tag/v2.34.0) |
| 74 | + |
| 75 | +一种 Express 风格的、基于 fasthttp 的 HTTP web 框架。 |
| 76 | + |
| 77 | +7、[gocache 3.0 发布](https://github.com/eko/gocache) |
| 78 | + |
| 79 | +完整的 Go 缓存库,为你带来多种管理缓存的方式。 |
| 80 | + |
| 81 | +8、[ebpf 0.9 发布](https://github.com/cilium/ebpf) |
| 82 | + |
| 83 | +纯 Go 实现的 eBPF 库。 |
| 84 | + |
| 85 | +## 文章 |
| 86 | + |
| 87 | +1、[Go 引入箭头函数,你支持吗?](https://mp.weixin.qq.com/s/0q9z2cLcKmxZDfAdNohInA) |
| 88 | + |
| 89 | +提案讨论地址:https://github.com/golang/go/issues/21498。 |
| 90 | + |
| 91 | +2、[牛逼了!Go已主导后端开发,已有330万开发者](https://mp.weixin.qq.com/s/2okEsOShrF-KawXRzE6nlg) |
| 92 | + |
| 93 | +开发者调查分析公司 SlashData 发布了一份题为“第 22 届开发者国家状况”的报告。 |
| 94 | + |
| 95 | +3、[太赞了!Go语言最全优化技巧总结,必须收藏](https://mp.weixin.qq.com/s/IG4HRjU-pOeaKBZ1ZRSiSQ) |
| 96 | + |
| 97 | +本文总结了在维护go基础库过程中,用到或者见到的一些性能优化技巧,现将一些理解梳理撰写成文,和大家探讨。 |
| 98 | + |
| 99 | +4、[真好!这本 Go 图书的泛型章节,免费下载了](https://mp.weixin.qq.com/s/kZMaPfw0gsExFZzwvESC0g) |
| 100 | + |
| 101 | +发现一本书:《Learning Go: An Idiomatic Approach to Real-World Go Programming》,是去年(2021)4 月份初版的,好评率挺高的。 |
| 102 | + |
| 103 | +5、[Go 泛型那些事:能做什么,不能做什么,如何改变惯用模式](https://mp.weixin.qq.com/s/Vqhit3pscBouh7dCpnVyZA) |
| 104 | + |
| 105 | +前两天分享了《Learning Go》最后一章作者重写的 PDF,今天有 gopher 翻译成了中文,经过译者授权发布。 |
| 106 | + |
| 107 | +6、[Go 开源项目推荐:一个简单的 Go 练手项目](https://mp.weixin.qq.com/s/GGr4PYi5atJ4344S_Fu9_g) |
| 108 | + |
| 109 | +Go 语言中文网微信群时不时有人问,有没有练手项目推荐。实话说,公众号陆续推荐过不少,但大家更擅长及时问,而不是找找。今天看到一个开源项目,值得学习了 Go 语言,但没有实战过的人练练手。 |
| 110 | + |
| 111 | +7、[自动发现 Go 项目 Bug 的神器](https://mp.weixin.qq.com/s/VcX6MGx39rz3q0DcwH783A) |
| 112 | + |
| 113 | +Go1.18 新特性中有一个神器:Fuzzing,对于发现 Go 项目中的 Bug 很有帮助。本文通过一个具体的例子来介绍它的基本使用,希望你能掌握并应用。 |
| 114 | + |
| 115 | +## 开源项目 |
| 116 | + |
| 117 | +1、[nibbles](https://github.com/gophun/nibbles) |
| 118 | + |
| 119 | +Go 实现的贪吃蛇游戏。 |
| 120 | + |
| 121 | +2、[typioca](https://github.com/bloznelis/typioca) |
| 122 | + |
| 123 | +Go 实现的打字速度测试仪。 |
| 124 | + |
| 125 | +3、[concurrent-map](https://github.com/orcaman/concurrent-map) |
| 126 | + |
| 127 | +相比标准库的 sync.Map,该库试用范围更广。目前支持泛型。 |
| 128 | + |
| 129 | +4、[go-mssqldb](https://github.com/microsoft/go-mssqldb) |
| 130 | + |
| 131 | +微软 fork 版 SQL Server Driver。 |
| 132 | + |
| 133 | +5、[dxsvalue](https://github.com/suiyunonghen/dxsvalue) |
| 134 | + |
| 135 | +网友自荐。从 JSON、MsgPack 等格式编解码。 |
| 136 | + |
| 137 | +## 资源&&工具 |
| 138 | + |
| 139 | +1、[god](https://github.com/pioz/god) |
| 140 | + |
| 141 | +部署和管理 Go 服务的工具。 |
| 142 | + |
| 143 | +2、[sish](https://github.com/antoniomika/sish) |
| 144 | + |
| 145 | +类似 ngrok 的工具。 |
| 146 | + |
| 147 | +## 订阅 |
| 148 | + |
| 149 | +这个周刊每周日发布,同步更新在[Go语言中文网](https://studygolang.com/go/weekly)和[微信公众号](https://weixin.sogou.com/weixin?query=Go%E8%AF%AD%E8%A8%80%E4%B8%AD%E6%96%87%E7%BD%91)。 |
| 150 | + |
| 151 | +微信搜索"Go语言中文网"或者扫描二维码,即可订阅。 |
| 152 | + |
| 153 | + |
0 commit comments