unittest框架测试用例 TestCase类中定义的几个特殊方法如下: (1)setUp():每个测试方法运行前运行,测试前的初始化工作; (2)tearDown():每个测试方法结束后运行,测试后的清理工作; (3)setUpClass():所有测试方法运行前运行,单元测试前期准备,必须使用@ ...
分类:
其他好文 时间:
2021-04-20 14:41:03
阅读次数:
0
golang easyjson使用 1.先安装easyjson go get -u github.com/mailru/easyjson/ 2.在结构体上加//easyjson:json的注解 //easyjson:json type School struct { Name string `jso ...
分类:
Web程序 时间:
2021-04-20 14:21:08
阅读次数:
0
学习rabbitMQ时 自己写了一个发送者 案例 运行后报错: Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(r ...
分类:
数据库 时间:
2021-04-20 14:20:37
阅读次数:
0
匿名函数 ::操作符 A static method (ClassName::methName) An instance method of a particular object (instanceRef::methName) A super method of a particular obje ...
分类:
编程语言 时间:
2021-04-16 12:22:24
阅读次数:
0
参考下面的代码即可。 package main import ( "time" "fmt" ) func main() { //获取当前时间 t := time.Now() //2018-07-11 15:07:51.8858085 +0800 CST m=+0.004000001 fmt.Prin ...
分类:
其他好文 时间:
2021-04-15 12:17:48
阅读次数:
0
一、全局异常处理之注解方式 主要用到的注解有2个 @ControllerAdvice 用在Controller类级别上,可看做是一个增强的Controller @ExceptionHandler 用到Controller中具体的方法上,表明这个方法处理的具体某个异常类型 我们一般在捕获到异常的时候, ...
分类:
编程语言 时间:
2021-04-14 12:09:04
阅读次数:
0
一、Golang开发环境搭建 1.下载安装jetbrain Goland IDE 下载地址:https://www.jetbrains.com/go/download/#section=windows 2.安装golang编译器 下载地址:https://golang.google.cn/doc/i ...
分类:
其他好文 时间:
2021-04-13 12:35:02
阅读次数:
0
一、背景 今天看到组内项目中有这样一段代码 ,第一反应是局部变量 index 太奇怪了,当然也不能说这样写是错的,只是个人强迫症看着很难受... 1 for _, index := range entities { 2 key := index.TemplateId 刚好借此机会,梳理下 Go 的 ...
分类:
其他好文 时间:
2021-04-13 12:32:49
阅读次数:
0
package stream import ( "log" "reflect" "sort" ) type ( // a Stream is where one can drain data from Stream chan interface{} // buffer stream BufferSt ...
##RequestMapping RequestMapping中的method方法 method:指定请求的method类型, GET、POST、PUT、DELETE等; ##GetMapping 看一下注解的底层源码 可以看到底层用了@RequestMapping(method = Request ...
分类:
移动开发 时间:
2021-04-13 11:47:36
阅读次数:
0