首页
AI Coding
NEW
沸点
课程
直播
活动
AI刷题
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
会员
登录
注册
Golang 源码笔记
littleCat
创建于2023-02-27
订阅专栏
看什么都不如看源码
等 2 人订阅
共15篇文章
创建于2023-02-27
订阅专栏
默认顺序
默认顺序
最早发布
最新发布
compile command
The //go:nosplit directive must be followed by a function declaration. It specifies that the functio
defer
https://go.dev/ref/spec#Defer_statements A "defer" statement invokes a function whose execution is d
Closure
Closure Closure occurs when an anonymous function in Go has access to its surroundings. Then it can
Type declarations
Type declarations Alias declarations An alias declaration binds an identifier to the given type. Wit
five-things-that-make-go-fast
参考:https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast 1.compact data structures Go let
Value Parts
参考:https://go101.org/article/value-part.html Solo Direct Value Part boolean types numeric types poin
Inlining optimisations in Go
参考: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go What is inlining? Inlining is th
ListenAndServe
每个请求都会开启一个go routine 执行 c.serve 每个请求都会开启一个go routine 执行 c.serve
gopark
gopark Puts the current goroutine into a waiting state and calls unlockf on the system stack. If unl
sleep、 ticker、timers
sleep 定义 // Sleep pauses the current goroutine for at least the duration d. // A negative or zero du
slice
创建slice 下标 通过下标的方式获得数组或者切片的一部分; 使用下标初始化切片不会拷贝原数组或者原切片中的数据,它只会创建一个指向原数组的切片结构体,所以修改新切片的数据也会修改原切片。 字面量
Random Number Generators
参考:https://www.math.utah.edu/~pa/Random/Random.html What is a random number generator? Transformatio
graceful shut down
Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown work
Priority Inversion
Now the task priorities are in the order of L < M < H.
Goroutine scheduler 及 Worker thread parking/unparking
Goroutine scheduler 及 Worker thread parking/unparking