mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
[PR #365] [CLOSED] fix: Use source generation for managing AAGUID dataset #849
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/365
Author: @ItalyPaleAle
Created: 3/20/2025
Status: ❌ Closed
Base:
main← Head:aaguid-source-gen📝 Commits (1)
a7407a9Use source generation for managing AAGUID dataset📊 Changes
6 files changed (+367 additions, -57 deletions)
View changed files
📝
.github/workflows/update-aaguids.yml(+20 -0)➕
backend/internal/utils/aaguid_map_gen.go(+265 -0)📝
backend/internal/utils/aaguid_util.go(+8 -30)📝
backend/internal/utils/aaguid_util_test.go(+3 -26)📝
backend/resources/files.go(+2 -1)➕
backend/tools/gen-aaguid/main.go(+69 -0)📄 Description
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 fileMakes 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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.