It has only to do with the act of correct observation, and by I mean a physical contact with all sorts of objects through all the senses

Golang 反射使用的一些技巧

Some tips for using reflection in Golang

What 类型(Type)与种类(Kind) Value 值 反射的使用 三个规则 CanSet 和 CanAddr 方法区别 Elem() 和 Indirect() 的区别 场景和技巧 初始化一个值 通过反射修改变量的值 类型获取 Struct 使用 指针 Map 使用 数组使用 Interfa

修复 targetcli 换行错误

fix exec targetcli cmd readline error

在 Golang 中调用 targetcli 命令进行交互操作时发现报了如下的错误: Go Copy exit status 1 exit status 1 Traceback (most recent call last) File \"/usr/lib/python3/dist-packa

Golang 执行交互命令

go exec interact command like python

进程创建 Go 创建子进程 查找可执行程序 exec CMD 交互式命令实现 Golang 中执行一次性命令是比较简单的直接调用 exec.Cmd.Run() 即可,那怎么执行交互式的命令比如 python 我们想动态的执行一些 python 的命令并获取他们的结果,而不是直接执行一个 .py 的

Golang 一段代码性能的探究

golang concurrence performance

我们来看下面这样的一段代码 var arr []int64 func IncrArrItem(s, e int) { for i = 0; i < 200000000; i++ { arr[s]++ arr[e]++ } } Shell 这个代码的作用是对的数组中的第 s 和 e 位

Golang 空结构体

go empty struct

空结构体是指一个 struct 里不包含任何字段 type A struct{} 它的宽度是0,占用 0 字节的内存 unsafe.Sizeof(s) // 0 由纯空结构体组成的对象也不会占用内存空间 type A struct { B struct{} C struct{} } //

golang 指针操作

golang pointer operation

在 go 语言中每个变量都有自己的地址,记录变量地址的类型称为指针类型 & 获取变量的地址,生成一个 *T 的指针类型指向取值变量 x x 必须是可以寻址的 * 获取指针指向的值 如果指针是 nil 会 panic 如果变量不是指针类型会报编译错误 invalid operation canno

Golang 调度器

golang scheduler

https//www.ardanlabs.com/blog/2018/08/scheduling-in-go-part1.html https//docs.google.com/document/d/1TTj4T2JO42uD5ID9e89oa0sLKhJYD0Y_kqxDv3I3XMw/edi