diff --git a/internal/lua/api_socket_tcp_test.go b/internal/lua/api_socket_tcp_test.go index 6f7be13..ce80933 100644 --- a/internal/lua/api_socket_tcp_test.go +++ b/internal/lua/api_socket_tcp_test.go @@ -804,13 +804,12 @@ func TestCheckTCPSocket_ArgError(t *testing.T) { // 传入非 userdata 应该 raise error L.Push(glua.LString("not a socket")) - err := L.PCall(0, 0, nil) + _ = L.PCall(0, 0, nil) // 这不会触发 checkTCPSocket,我们需要通过 Lua 脚本来测试 - err = L.DoString(` + _ = L.DoString(` local sock = ngx.socket.tcp() `) // 在没有注册 API 的情况下会失败 - _ = err } // TestLuaAPI_tcpSocketConnect_WithTimeout 测试 connect 带超时选项 diff --git a/internal/middleware/security/auth_test.go b/internal/middleware/security/auth_test.go index 264a332..d7d9b77 100644 --- a/internal/middleware/security/auth_test.go +++ b/internal/middleware/security/auth_test.go @@ -547,7 +547,7 @@ func TestHashPassword(t *testing.T) { t.Errorf("Expected argon2id hash, got %s", hash) } - hash, err = HashPassword(password, HashAlgorithm(99)) + _, err = HashPassword(password, HashAlgorithm(99)) if err == nil { t.Error("Expected error for unknown algorithm") }