随笔分类 - golang
摘要:Go\src\sync\poolqueue.go // poolDequeue is a lock-free fixed-size single-producer, // multi-consumer queue. The single producer can both push and pop
阅读全文
摘要:https://zhuanlan.zhihu.com/p/349197066
阅读全文
摘要:devtool显示的bug Go JSON (Un)Marshalling, Missing Fields and Omitempty · vsupalov.com https://vsupalov.com/go-json-omitempty/ golang中的排序,按照结构体的某个字段排序_rao
阅读全文
摘要:https://mp.weixin.qq.com/s/PN-tyUEez2rQT9aitxjy2g
阅读全文
摘要:轻松上手!手把手带你掌握从Context到go设计理念 https://mp.weixin.qq.com/s/z4XPnfc41U5OMqGqs9Pf8w 搜索 复制
阅读全文
摘要:Debugging Go Programs using Delve - golangbot.com https://golangbot.com/debugging-go-delve/ Golang Debugging With Delve [Step by Step] | Golang Cafe h
阅读全文
摘要:C source files not allowed when not using cgo or SWIG 搜索 复制
阅读全文
摘要:// Check if the context is expired. select { default: case <-ctx.Done(): db.mu.Unlock() return nil, ctx.Err() } Go\src\database\sql\sql.go
阅读全文
摘要:小结: 1、 序列化访问 Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access. To serialize access, protect t
阅读全文
摘要:for (int i = 0; i < 4; ++i) c 执行结果一样 for i := 0; i <N; ++i { go 不能编译 1 2 #include <stdio.h> 3 int main() 4 { 5 int i,j; 6 i++; 7 ++j; 8 } 1 .file "loo
阅读全文
摘要:github.com\google\gopacket@v1.1.19\pcap\pcap_windows.go switch goroutines // waitForPacket waits for a packet or for the timeout to expire. func (p *H
阅读全文
摘要:小结: 1、 stack allocation he space is stored on the goroutine stack. escape to the heap the Go compiler cannot determine its lifetime 垃圾回收目标:堆空间大小始终低于目标
阅读全文
摘要:Golang 中反射的应用与理解 https://mp.weixin.qq.com/s/TmzV2VTfkE8of2_zuKa0gA Golang 中反射的应用与理解 原创 赵燕辉 字节跳动技术团队 2022-08-23 12:00 发表于北京 字节跳动技术团队 字节跳动的技术实践分享 231篇原创
阅读全文
摘要:func mapKeyOrder() { m := map[int]struct{}{} for i := 0; i < 16; i++ { m[i] = struct{}{} } for i := 0; i < 16; i++ { l := []int{} for k := range m { l
阅读全文
摘要:Go组件:context学习笔记! https://mp.weixin.qq.com/s/OCpVRwtiphFRZgu9zdae5g
阅读全文
摘要:3) 保证一定有一行返回 SELECT COUNT(*),IF(a.Id IS NULL,0,123) ,a.Id rows.Scan(&Val, 2) mysql `ThresholdMin` DECIMAL(20,6) NOT NULL DEFAULT '0.000000' COMMENT '阈
阅读全文
摘要:u := v u.DeviceModelMonitorTemplateId = v.Id u.Id = int32(Id)
阅读全文
摘要:https://golang.design/under-the-hood/zh-cn/part1basic/ch03lang/chan/ Channel 底层结构 实现 Channel 的结构并不神秘,本质上就是一个 mutex 锁加上一个环状缓存、 一个发送方队列和一个接收方队列: 1 2 3 4
阅读全文
摘要:func tctx() { f := func() context.Context { ctx := context.TODO() ctx = context.WithValue(ctx, "k", "v") myprint(ctx.Value("k")) return ctx } ctx := f
阅读全文

浙公网安备 33010602011771号