majunmin / blog-comments

blog-comment
0 stars 0 forks source link

Go-Test-Gomonkey使用 | majm的博客 #1

Open majunmin opened 5 months ago

majunmin commented 5 months ago

https://majunmin.github.io/post/Go-Test-Gomonkey%E4%BD%BF%E7%94%A8.html

golang的单测, 有一些约定, 例如文件名是 xxx.go, 测试文件名必须是 xxx_test.go, 且测试函数的方法名 都是以 Test开头, 使用go test 命令, 有时发现mock不住,一般都是内联(简短)函数mock失败,可以执行的时候加上编译条件禁止内联 -gcflags=all=-l. Feature: support a patch for a function su

majunmin commented 5 months ago

这是一个测试评论