Skip to content

drop mapToStruct and spaceResultToJSON, both dead with no duplicate call sites - #377

Merged
gerardrecinto merged 1 commit into
masterfrom
kill-dead-map-struct-json-helpers
Sep 19, 2026
Merged

gerardrecinto merged 1 commit into
masterfrom
kill-dead-map-struct-json-helpers

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

Two more from the U1000 pile.

mapToStruct (api_core.go): a JSON-roundtrip map-to-struct helper marked 'for adapters,' zero callers. Checked whether any other code does the same marshal/unmarshal pattern inline that should be wired to it instead - found one similar-looking spot (expandNativePromptArgs in engine_native.go) but it's a map-to-map normalization with different fallback semantics, not the same thing, no real duplication to fix.

spaceResultToJSON (api_space.go): a struct-to-JSON-string helper marked 'for backward compatibility,' zero callers, and the only json.Marshal call in the whole file is its own.

Both removed along with the now-unused encoding/json imports in each file. Build+vet+gofmt+test clean.

@github-actions

Copy link
Copy Markdown

Gemini PR Review

The diff removes two helper functions (mapToStruct and spaceResultToJSON) and their corresponding encoding/json imports from api_core.go and api_space.go respectively.

Assuming these functions were either unused or their functionality has been correctly refactored and replaced elsewhere in the codebase, this diff looks good.

  • Code quality and readability
    • Removes seemingly unused or redundant helper functions, which improves code cleanliness and reduces boilerplate.

@gerardrecinto
gerardrecinto merged commit 4d514c3 into master Sep 19, 2026
21 checks passed
@gerardrecinto
gerardrecinto deleted the kill-dead-map-struct-json-helpers branch September 19, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant