style(benchmark): 修复代码格式和忽略无用错误返回值
This commit is contained in:
parent
668ecde6db
commit
84c26c61ca
@ -24,9 +24,9 @@ func setupStaticTestDir() (string, func()) {
|
||||
// 创建测试文件
|
||||
testFiles := map[string][]byte{
|
||||
"index.html": []byte("<html><body>Index</body></html>"),
|
||||
"style.css": make([]byte, 1024), // 1KB
|
||||
"large.json": make([]byte, 10*1024), // 10KB
|
||||
"nested/file.js": make([]byte, 5*1024), // 5KB
|
||||
"style.css": make([]byte, 1024), // 1KB
|
||||
"large.json": make([]byte, 10*1024), // 10KB
|
||||
"nested/file.js": make([]byte, 5*1024), // 5KB
|
||||
}
|
||||
|
||||
for path, content := range testFiles {
|
||||
@ -40,7 +40,7 @@ func setupStaticTestDir() (string, func()) {
|
||||
}
|
||||
|
||||
cleanup := func() {
|
||||
os.RemoveAll(dir)
|
||||
_ = os.RemoveAll(dir)
|
||||
}
|
||||
|
||||
return dir, cleanup
|
||||
|
||||
@ -21,7 +21,7 @@ func BenchmarkAccessLogProcess(b *testing.B) {
|
||||
},
|
||||
}
|
||||
al := New(cfg)
|
||||
defer al.Close()
|
||||
defer func() { _ = al.Close() }()
|
||||
|
||||
mockHandler := func(ctx *fasthttp.RequestCtx) {
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
@ -49,7 +49,7 @@ func BenchmarkAccessLogProcessParallel(b *testing.B) {
|
||||
},
|
||||
}
|
||||
al := New(cfg)
|
||||
defer al.Close()
|
||||
defer func() { _ = al.Close() }()
|
||||
|
||||
mockHandler := func(ctx *fasthttp.RequestCtx) {
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user