Go: fix warnings (#17738)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-08-03 21:30:01 +08:00
committed by GitHub
parent d357eea8ef
commit 86021932ae
103 changed files with 437 additions and 439 deletions

View File

@@ -204,7 +204,7 @@ class TestAttachmentDownloadMissingBlob:
"""Regression for #15502: missing-blob → structured 4xx, not HTTP 500."""
def test_empty_blob_returns_not_found(self, monkeypatch: pytest.MonkeyPatch) -> None:
"""Storage returns None (orphaned metadata) → 'Document not found!' 4xx,
"""Storage returns None (orphaned metadata) → 'document not found' 4xx,
not a TypeError 500 from make_response(None)."""
module = _load_agent_api(monkeypatch, storage_get=lambda *_a, **_k: None)
result = asyncio.run(module.download_attachment(tenant_id="t1", attachment_id="orphan"))

View File

@@ -107,7 +107,7 @@ def test_validate_immutable_fields_chunk_count_mismatch():
doc.progress = 0.5
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `chunk_count`."
assert error_msg == "can't change `chunk_count`"
assert error_code == RetCode.DATA_ERROR
@@ -120,7 +120,7 @@ def test_validate_immutable_fields_token_count_mismatch():
doc.progress = 0.5
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `token_count`."
assert error_msg == "can't change `token_count`"
assert error_code == RetCode.DATA_ERROR
@@ -133,7 +133,7 @@ def test_validate_immutable_fields_progress_mismatch():
doc.progress = 0.5
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `progress`."
assert error_msg == "can't change `progress`"
assert error_code == RetCode.DATA_ERROR
@@ -185,7 +185,7 @@ def test_validate_immutable_fields_zero_values_must_match():
doc.progress = 0.5
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `chunk_count`."
assert error_msg == "can't change `chunk_count`"
assert error_code == RetCode.DATA_ERROR
@@ -198,7 +198,7 @@ def test_validate_immutable_fields_zero_token_count_mismatch_when_chunk_count_ma
doc.progress = 0.0
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `token_count`."
assert error_msg == "can't change `token_count`"
assert error_code == RetCode.DATA_ERROR
@@ -211,7 +211,7 @@ def test_validate_immutable_fields_zero_progress_mismatch_when_counts_match():
doc.progress = 0.5
error_msg, error_code = validate_immutable_fields(update_doc_req, doc)
assert error_msg == "Can't change `progress`."
assert error_msg == "can't change `progress`"
assert error_code == RetCode.DATA_ERROR