[PR #365] fix: Use source generation for managing AAGUID dataset #853

Closed
opened 2025-10-07 00:23:29 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/pocket-id/pocket-id/pull/365

State: closed
Merged: No


Small improvement over #332 as discussed here: https://github.com/pocket-id/pocket-id/pull/332#discussion_r2002362424

Instead of bundling the JSON file into the compiled binary, for it to be parsed at runtime, this uses source generation (go generate) to parse it at build-time and generate a Go file

Makes the code simpler (there's a Go map embedded in the source) as well as faster since there's no need to parse a JSON file at runtime (and synchronize concurrent access).

CC @kmendell

**Original Pull Request:** https://github.com/pocket-id/pocket-id/pull/365 **State:** closed **Merged:** No --- Small improvement over #332 as discussed here: https://github.com/pocket-id/pocket-id/pull/332#discussion_r2002362424 Instead of bundling the JSON file into the compiled binary, for it to be parsed at runtime, this uses source generation ([`go generate`](https://go.dev/blog/generate)) to parse it at build-time and generate a Go file Makes the code simpler (there's a Go map embedded in the source) as well as faster since there's no need to parse a JSON file at runtime (and synchronize concurrent access). CC @kmendell
OVERLORD added the pull-request label 2025-10-07 00:23:29 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#853