上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 218 下一页

2021年9月7日

centos6 yum 源失效 404,终于解决了

摘要: YumRepo Error: All mirror URLs are not using ftp, http[s] or file.Eg. Invalid release/repo/arch combination/removing mirrorlist with no valid mirrors: 阅读全文

posted @ 2021-09-07 22:26 ExplorerMan 阅读(393) 评论(0) 推荐(0) 编辑

GOMAXPROCS你设置对了吗?

摘要: 1. 前言 有圈子的朋友介绍 uber-go/automaxprocs, 我才发现之前在docker中, Golang程序设置的GOMAXPROCS不正确,有必要在重新回顾一下了。 2. Go 调度器: M, P 和 G 我们知道在Go scheduler中,G代表goroutine, P代表Log 阅读全文

posted @ 2021-09-07 21:15 ExplorerMan 阅读(2055) 评论(0) 推荐(0) 编辑

容器资源可见性问题与 GOMAXPROCS 配置

摘要: Go 程序启动时候会根据 CPU 数量设置 GOMAXPROCS,比如下面的程序中在 8 核处理下输出为 8。 package main import ( "runtime" ) func main() { println(runtime.NumCPU()) } 当我们使用 Docker 的时候也是 阅读全文

posted @ 2021-09-07 21:14 ExplorerMan 阅读(654) 评论(0) 推荐(0) 编辑

2021年8月26日

windows下 charles 手机app抓包

摘要: windows下抓包 下载地址https://www.charlesproxy.com/latest-release/download.do 打开charles proxy -> proxy setting Port改为 8888 (这个随意 自己要记住 端口号做好高于或等于8888) 随便下载一个 阅读全文

posted @ 2021-08-26 15:24 ExplorerMan 阅读(264) 评论(0) 推荐(0) 编辑

2021年8月18日

Go语言参数校验(go-playground / validator)——基本使用

摘要: Go语言没有像Java一样的注解快速进行参数的校验,但可以通过struct tag(结构体标签)进行序列化。常用的如: type User struct { ID string `json:"id"` Name string `json:"name"` Age string `json:"age"` 阅读全文

posted @ 2021-08-18 16:11 ExplorerMan 阅读(940) 评论(0) 推荐(0) 编辑

2021年8月17日

自定义json unmarshaler返回空字段

摘要: 我已经实现了一个自定义JSON解组器,但由于某种原因它不会返回正确的值 - 所有字段都会返回零。自定义json unmarshaler返回空字段 例如: type test struct { t string } func New(data string) (*test, error) { retu 阅读全文

posted @ 2021-08-17 11:24 ExplorerMan 阅读(233) 评论(0) 推荐(0) 编辑

2021年7月30日

golang的select典型用法

摘要: golang 的 select 的功能和 select, poll, epoll 相似, 就是监听 IO 操作,当 IO 操作发生时,触发相应的动作。 示例: ch1 := make (chan int, 1) ch2 := make (chan int, 1) ... select { case 阅读全文

posted @ 2021-07-30 14:37 ExplorerMan 阅读(905) 评论(0) 推荐(0) 编辑

vscode配置git和提交代码到github教程

摘要: 用了git最方便的就是比如在公司写了很多代码后回到家打开vscode只需要点击一下pull就能全部同步过来。是不是很方便。。。。毕竟之前我都是拿u盘拷贝回家或者存到云盘再下载下来。。 我这里用的是国内的码云托管的代码,,github都是英文看不懂。。 因为vscode中带的有git管理功能,只需要学 阅读全文

posted @ 2021-07-30 10:51 ExplorerMan 阅读(7618) 评论(0) 推荐(1) 编辑

VsCode中好用的git源代码管理插件GitLens

摘要: git多人协作的时候需要查看日志,如果能在当前代码中查看到那是很方便的一件事,能省去很多时间去其他工具查看,提高工作效率。 VsCode中的GitLens插件刚好能满足这个需求,而且搭配Cmder使用,很舒服,不会出现换行不工整的问题,还可以设置自己喜欢的主题,可以用爱不释舍来形容。 GitLens 阅读全文

posted @ 2021-07-30 10:44 ExplorerMan 阅读(2891) 评论(0) 推荐(0) 编辑

2021年7月29日

GoMock框架使用指南

摘要: 序言 要写出好的测试代码,必须精通相关的测试框架。对于Golang的程序员来说,至少需要掌握下面四个测试框架: GoConvey GoStub GoMock Monkey 读者通过前面三篇文章的学习可以对框架GoConvey和GoStub优雅的组合使用了,本文将接着介绍第三个框架GoMock的使用方 阅读全文

posted @ 2021-07-29 14:17 ExplorerMan 阅读(672) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 218 下一页

导航