摘要:
const imgStrPrefix = "data:image/png;base64," func imgToStr(imgContent bytes.Buffer) string { return imgStrPrefix + base64.StdEncoding.EncodeToString( 阅读全文
摘要:
curl localhost:8888/debug/pprof/heap >heap.base sleep 60s curl localhost:8888/debug/pprof/heap >heap.current go tool pprof -http localhost:8889 -base 阅读全文
摘要:
type JsonTime time.Time func (j JsonTime) MarshalJSON() ([]byte, error) { //时间为空默认格式 if time.Time(j).IsZero() { return []byte(`""`), nil } return []by 阅读全文
摘要:
func show_strlen(s string) int { sl := 0 rs := []rune(s) for _, r := range rs { rint := int(r) if rint < 128 { sl++ } else { sl += 2 } } return sl } # 阅读全文
摘要:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 2.修改配置文件~/.pip/pip.conf 3.pip install locustio -i https://pypi.tuna.tsinghua. 阅读全文
摘要:
【转】https://www.cnblogs.com/swordfall/p/10841418.html 本文是基于windows 下 MongoDB 4.0编写,据了解MongoDB在3.0以后的版本中权限设置有变化。 1. 创建超级用户 安装完之后,打开命令行,进入mongodb安装目录,在bi 阅读全文
摘要:
大概率跨系统导致的问题。是因为windows和linux默认编码不一致,当出现中文时,又没声明编码格式,会出现这种情况。 解决方案: 例如python # -*- coding: utf-8 -*- 阅读全文
摘要:
func HandleResp (ctx *gin.Context, apiInfo models.ApiInfo) error{ var buf bytes.Buffer reqbody,err := ioutil.ReadAll(ctx.Request.Body) //fmt.Println(" 阅读全文
摘要:
或者阿里云镜像代理 export GOPROXY=https://mirrors.aliyun.com/goproxy/ 阅读全文