Skip to content

Commit 6c84e41

Browse files
committed
docs: add note about not modifying exported enum slices
document that StatusValues and StatusNames are exported slices that should not be modified as this would affect all code using the enum.
1 parent 9cda39d commit 6c84e41

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ _, err = db.Exec("UPDATE users SET status = ? WHERE id = ?", StatusActive, userI
257257

258258
- **Parsing**: O(1) constant time using map lookup (previously O(n) with switch statement)
259259
- **Values/Names access**: Zero allocation - returns pre-computed package variables
260+
261+
> **Note**: `StatusValues` and `StatusNames` are exported slices. Do not modify them as this would affect all code using the enum.
260262
- **Memory efficient**: Single shared instance for each enum value
261263
- **Declaration order**: Preserved from source code, not alphabetically sorted
262264

0 commit comments

Comments
 (0)