上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 234 下一页

2021年11月9日

python下SimpleHTTPServer 用法

摘要: 从VMware workstation虚拟机里面的linux传输文件时,除了ssh和scp、ftp常见的方法外,还有python下SimpleHTTPServer小工具也可以快捷的进行文件分析 SimpleHTTPServer是Python 2自带的一个模块,是Python的Web服务器。在Pyth 阅读全文

posted @ 2021-11-09 14:32 ExplorerMan 阅读(560) 评论(0) 推荐(0)

2021年11月4日

Go语言(golang)新发布的1.13中的Error Wrapping深度分析

摘要: 2019.09.03日,Golang 1.13版本发布,这次更新算是比较大的了,有大家期待的GOPROXY和GOPRIVATE等,具体的可以去看这个版本的 Go 1.13 Release Notes。 Go 1.13发布的功能还有一个值得深入研究的,就是对Error的增强,也是今天我们要分析的 Er 阅读全文

posted @ 2021-11-04 15:05 ExplorerMan 阅读(329) 评论(0) 推荐(0)

2021年11月3日

30分钟通过Kong实现.NET网关

摘要: 目录 什么是Kong 原理 安装Kong 安装可视化界面Konga Kong代理HTTP服务 Kong代理Grpc服务 Kong负载Http服务 Kong负载Grpc服务 集成IdentityServer4实现JWT认证 RateLimit限流插件 Cache插件 日志插件 正文 回到顶部 什么是K 阅读全文

posted @ 2021-11-03 16:07 ExplorerMan 阅读(296) 评论(0) 推荐(0)

2021年11月2日

Golang 函数耗时统计

摘要: 1.朴素方法 在函数起始位置计算当前时间,在函数结束位置算出耗时。 package main import ( "fmt" "time" ) func sum(n int) int { startT := time.Now() //计算当前时间 total := 0 for i:=1; i <= n 阅读全文

posted @ 2021-11-02 19:25 ExplorerMan 阅读(878) 评论(0) 推荐(0)

2021年10月24日

go micro metrics 接入Prometheus、Grafana

摘要: 本文介绍go micro中加入metric, 并接入Prometheus、Grafana 1.go micro中间件加载prometheus plugins go micro中提供了prometheus plugins github.com/micro/go-plugins/wrapper/moni 阅读全文

posted @ 2021-10-24 23:39 ExplorerMan 阅读(429) 评论(0) 推荐(0)

2021年10月18日

go module使用教程:使用go mod的方法.报错go: cannot determine module path for source directory

摘要: 使用go mod的方法 单独从大工程里拷出小文件想新建新文件工程时,部分文件路径名报红,出现报错go: cannot determine module path for source directory E:\tttttt (outside GOPATH, no import comments)1. 阅读全文

posted @ 2021-10-18 20:05 ExplorerMan 阅读(1731) 评论(0) 推荐(0)

2021年10月13日

golang三大基础mock大法

摘要: 一、使用gomonkey来mock函数和方法 1、mock函数 gomonkey.ApplyFunc(target,double) 其中target是被mock的目标函数,double是用户重写的函数。 注意点:重写的函数要和原函数入参和出参保持一致,否则会报错。 2、mock方法 gomonkey 阅读全文

posted @ 2021-10-13 14:16 ExplorerMan 阅读(2186) 评论(0) 推荐(0)

2021年10月12日

用vscode开发调试golang超简单教程

摘要: 目录 一、下载并安装vscode 二、安装Go插件 三、下载调试工具 四、打开现有go工程文件夹或新建go项目即可进行调试 五、问题处理 首先安装golang开发环境,这个不用说。 到这个页面下载golang 的安装包 https://studygolang.com/dl ,再安装就可以了。 一、下 阅读全文

posted @ 2021-10-12 21:25 ExplorerMan 阅读(5348) 评论(0) 推荐(0)

2021年10月9日

go语言 判断一个实例是否实现了某个接口interface

摘要: package main import "fmt" type Animal interface { run() walk() } type Dog struct { Id int } func (dog Dog) run() { fmt.Printf("I am Dog,I can Run!\n") 阅读全文

posted @ 2021-10-09 17:53 ExplorerMan 阅读(156) 评论(0) 推荐(0)

2021年9月9日

golang,函数参数传递的sync.Mutex不是指针会怎么样

摘要: package main import ( "fmt" "sync")var a = 1func main() { lock := sync.Mutex{} wg := &sync.WaitGroup{} wg.Add(2) go t(lock,wg) go t(lock,wg) wg.Wait() 阅读全文

posted @ 2021-09-09 11:24 ExplorerMan 阅读(234) 评论(0) 推荐(0)

上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 234 下一页

导航