Go_perf

Dec 29, 2021·
1ch0
1ch0
· 1 min read

Go perf

1. net

1.1 拼接 ip

net.JoinHostPort(s.BindAddress, strconv.Itoa(s.BindPort))

1.2 设置 body

body := bytes.NewBufferString(`{"nickname":"admin2","email":"admin2@foxmail.com","phone":"1812885xxx"}`)

1.3 替换标准库

# 日志库能够兼容标准库 log 包,我们就可以很容易地替换掉标准库 log 包
# logrus 就兼容标准库 log 包
log "github.com/sirupsen/logrus"

IP签名

1ch0
Authors
Software Developer
Software Developer passionate about Go, Python, and Cloud Native technologies. Sharing my learning journey through technical blog posts.