style: fix formatting issues

- Add missing newlines at end of files
- Fix indentation in ssl.go
- Remove extra blank lines

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-04-30 13:42:53 +08:00
parent b1e1547e36
commit d269940d8b
10 changed files with 9 additions and 13 deletions

View File

@ -76,4 +76,4 @@ func platformSendfile(conn any, file *os.File, offset, length int64) error {
// macOS sendfile 签名复杂,简化使用 fallback
// Windows TransmitFile 需要特殊 API
return syscall.ENOTSUP
}
}

View File

@ -167,4 +167,4 @@ func getSocketFd(conn net.Conn) (uintptr, error) {
default:
return 0, syscall.ENOTSUP
}
}
}

View File

@ -149,4 +149,4 @@ func BenchmarkGzipCompress_Sizes(b *testing.B) {
}
})
}
}
}

View File

@ -107,4 +107,4 @@ func BenchmarkCacheKeyHash_Compare(b *testing.B) {
_, _ = p.buildCacheKeyHash(ctx)
}
})
}
}

View File

@ -34,4 +34,4 @@ func isInWhitelist(key []byte, whitelist map[string]bool) bool {
}
}
return false
}
}

View File

@ -140,7 +140,6 @@ func TestPoolConcurrentSubmit(t *testing.T) {
for range 100 {
wg.Go(func() {
_ = p.Submit(nil, func(_ *fasthttp.RequestCtx) {
counter.Add(1)
})

View File

@ -447,7 +447,6 @@ func (s *Server) startSingleMode() error {
s.fastServer = s.createFastServer(serverCfg, s.handler)
s.running = true
// 创建监听器并保存,用于热升级
@ -578,7 +577,6 @@ func (s *Server) startVHostMode() error {
s.fastServer = s.createFastServer(serverCfg, s.handler)
s.running = true
// 创建监听器并保存,用于热升级
@ -678,7 +676,6 @@ func (s *Server) startMultiServerMode() error {
// 创建 fasthttp.Server
fastSrv := s.createFastServer(serverCfg, h)
// 检查 SSL 配置
if serverCfg.SSL.Cert != "" && serverCfg.SSL.Key != "" {
tlsManager, err := ssl.NewTLSManager(&serverCfg.SSL)

View File

@ -131,12 +131,12 @@ func (m *SSLManager) GetTLSConfig() *tls.Config {
// 设置协议版本
if len(m.config.Protocols) > 0 {
tlsConfig.MinVersion = sslutil.ParseMinTLSVersion(m.config.Protocols)
tlsConfig.MinVersion = sslutil.ParseMinTLSVersion(m.config.Protocols)
}
// 设置加密套件
if len(m.config.Ciphers) > 0 {
tlsConfig.CipherSuites = sslutil.ParseCipherSuitesLenient(m.config.Ciphers)
tlsConfig.CipherSuites = sslutil.ParseCipherSuitesLenient(m.config.Ciphers)
}
// 配置客户端证书验证mTLS

View File

@ -90,4 +90,4 @@ func IPInAllowList(ip net.IP, allowList []net.IPNet) bool {
}
}
return false
}
}

View File

@ -179,4 +179,4 @@ func BenchmarkExpandAllocation_ContextReuse(b *testing.B) {
}
ReleaseContext(vc)
}
}