fix(lint): 修复代码清理和lint警告

- 移除 proxy.go 未使用的 protoHTTPS 常量
- 修复 api_shared_dict.go 无效赋值警告
- 修复 certpool.go unused-parameter 警告

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-04-13 11:44:04 +08:00
parent 6a08a6ab4a
commit 78c49f7288
3 changed files with 2 additions and 8 deletions

View File

@ -347,8 +347,7 @@ func dictFlushExpired(L *glua.LState) int {
// dictGetKeys 获取所有键
// dict:get_keys(max_count?) -> keys
func dictGetKeys(L *glua.LState) int {
//nolint:ineffassign,unused
_ = checkSharedDict(L)
checkSharedDict(L) // 验证参数但不使用返回值
// 暂不实现完整版,返回空表
keys := L.NewTable()

View File

@ -56,10 +56,6 @@ const (
// upstreamCache 上游缓存标识
// 用于标记请求可直接使用缓存响应,无需转发到上游
upstreamCache = "CACHE"
// protoHTTPS 使用 HTTPS 协议
// 标记与上游目标通信时使用 HTTPS 加密传输
protoHTTPS = "https"
)
// Proxy 表示反向代理实例,负责将 HTTP 请求转发到后端目标。

View File

@ -13,12 +13,11 @@ import (
//
// Parameters:
// - certFile: Certificate file path
// - context: Context description for error messages
//
// Returns:
// - *x509.CertPool: Certificate pool
// - error: Returns error if loading fails
func LoadCertPool(certFile string, context string) (*x509.CertPool, error) {
func LoadCertPool(certFile string, _ string) (*x509.CertPool, error) {
data, err := os.ReadFile(certFile)
if err != nil {
return nil, fmt.Errorf("failed to read certificate file: %w", err)