fix: use zero-length slice with capacity for EmailTemplates by lakhansamani · Pull Request #496 · authorizerdev/authorizer
Navigation Menu
{{ message }}
authorizerdev / authorizer Public
- Notifications You must be signed in to change notification settings
- Fork 204
Merged
fix: use zero-length slice with capacity for EmailTemplates#496
lakhansamani merged 3 commits intomainfrom
fix: use zero-length slice with capacity for EmailTemplates#496
lakhansamani merged 3 commits intomainfrom
Conversation
Copy link Copy Markdown
Contributor
lakhansamani
commented
Mar 1, 2026
lakhansamani
commented
Summary
- Changed
make([]*model.EmailTemplate, len(emailTemplates))tomake([]*model.EmailTemplate, 0, len(emailTemplates)) - Eliminates nil-padded entries in the API response
Test plan
- Verify EmailTemplates query returns correct data without nil entries
Fixes #485
lakhansamani added 3 commits
March 1, 2026 11:53The slice was created with len(emailTemplates) nil elements, then append added more entries after the nil padding. Changed to 0 length with pre-allocated capacity. Fixes #485
lakhansamani
merged commit
e38d88d
into
main
lakhansamani
deleted the
fix/email-templates-nil-slice
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment