Tags golang

context in golang

Kiyor | | Created: 01-20-17 18:39:36, Last Update: 01-24-17 10:48:12


# set value
child_ctx = context.WithValue(parent_ctx, key, value)

# get value


Category: none

Tags: context golang


golang 1.7 http client trace example

Kiyor | | Created: 08-23-16 08:46:59, Last Update: 08-23-16 11:07:26


most of code copy from official go/src/net/http/transport_test.go

package main


Category: none


golang 1.5 坑一枚

Kiyor | | Created: 08-25-15 07:24:48, Last Update: 08-28-15 11:18:50


golang 1.5 在常用的net/http包里新增了Request.Cancel, 导致原来可以直接把request给json化的方式出现了json: unsupported type: <-chan struct {}. 在debug的时候看不到请求了. 解决方式也十分坑…

type Req struct {


Category: none

Tags: golang