
golang
gtfeature
i'm gt / email: zhaojunlike@gmail.com
展开
-
cloudflare 关于tls 检测,发送未知message type字节
cloudflare 关于tls 检测,发送未知message type字节当我尝试使用伪造chrome tls 指纹发送给cloudflare保护站点的时候,他返回给我一个未知的服务器握手数据报文,查找文档后发现RFC 5246 serverhello 中没有对这个message type定义:https://tools.ietf.org/html/rfc5246#section-7.4.1.3...原创 2020-09-24 17:26:25 · 916 阅读 · 0 评论 -
golang cover协程异常
协程报错闪退协程如果不cover异常会出现闪退问题,但是在大批量创建各种协程每次都需要cover会非常难处理,golang 异常处理我不是很熟悉,简单写了一个,不知道是否靠谱commonpackage loggerimport ( "fmt" "reflect" "runtime" "strings")//创建安全的协程func CreateSafeGo(call func(), errCall func(err interface{})) { go原创 2020-06-16 11:53:17 · 543 阅读 · 0 评论 -
node-ffi 调用Golang动态库
node-ffi 调用Golang动态库node-ffi库以及无维护,尝试使用napi-fficonst ffi = require('ffi-napi');const fs = require('fs');console.log(process.arch, process.platform);//# 坑 不能使用除开dll其他的后缀export class AA { static dll; //這個加載太耗時了,这种不是IO,是CPU,所以只等API支持异步 sta原创 2020-06-03 16:11:03 · 3886 阅读 · 1 评论 -
QA:Golang抽象nil问题
问题描述比如说 a 变量是 *xxx , 他实现接口 Ixxx, 如果*xx 没有初始化 =nil,返回回去给ixxx,那么 Ixxx ! =nil 但是实际是nil如图所示启动LoadTaskManager 返回一个 定义为如下的接口type ITM interface{}fun(xx *xx) LoadTaskManager() ITM {}如果*xx 中有一个实现 ITM的,但是没有初始化的接口 *yeezy,此时直接判断 *yeezy=nil,但是如果返回这个 *yeez原创 2020-06-03 12:07:52 · 360 阅读 · 0 评论 -
v8go 库手动编译 v8 golang 库手动编译
v8go 手动编译v8 engine support golang bindding : https://rogchap.com/v8go克隆项目1.克隆项目git clone https://github.com/rogchap/v8go.git在克隆过程中最好使用proxy 不然速度非常的慢export http_proxy=http://$host:$portexport h...原创 2020-04-21 09:53:13 · 2994 阅读 · 4 评论 -
LOG.奇葩字节
奇葩字节最近遇到一个字节如图所示import ( "fmt" "testing")var code = "0"func TestNewApi(t *testing.T) { fmt.Println(code) fmt.Println([]byte(code)) fmt.Println(len(code))}=== RUN Test...原创 2020-04-15 19:54:27 · 201 阅读 · 0 评论 -
QA:golang redis协议同时写入报错
Q:使用redigo协程并发报错参考:https://studygolang.com/articles/21266协程同时sendwrite tcp 192.168.10.66:7289->192.168.10.66:6379: wsasend: An existing connection was forcibly closed by the remote host.协程同时D...原创 2020-01-14 22:18:40 · 1706 阅读 · 0 评论 -
golang.是用类axios.js的api请求http接口,支持proxy
golang axios项目地址:https://github.com/zhaojunlike/common-go创建实例func TestNewDefaultHttpRes(t *testing.T) { var opt = &Options{Proxy: &Proxy{Host: "127.0.0.1", Port: 8888}} client, _ :=...原创 2020-01-08 12:03:43 · 524 阅读 · 0 评论