chore: order alphabetical error codes and constants in reference#569
Open
zimeg wants to merge 4 commits into
Open
chore: order alphabetical error codes and constants in reference#569zimeg wants to merge 4 commits into
zimeg wants to merge 4 commits into
Conversation
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
==========================================
+ Coverage 71.68% 71.70% +0.01%
==========================================
Files 226 226
Lines 19144 19150 +6
==========================================
+ Hits 13723 13731 +8
+ Misses 4216 4214 -2
Partials 1205 1205 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
commented
Jun 2, 2026
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The ErrorCodeMap is a Go map, so iteration order was random — the generated errors.md output was non-deterministic. Sort entries by their Code field before rendering the template. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
N/A — no change to behavior but docs of #553 might keep new order 👁️🗨️ 📚
Summary
This pull request sorts the
internal/slackerror/errors.gofile alphabetically and ensuresdocgenproduces deterministic output.ErrXxxidentifier nameErrorCodeMapentries sorted by map keydocgennow explicitly sorts errors before rendering the templatePreview
Testing
diffof this PR has matching additions 🔬Notes
The Go spec states (ref):
Without explicit sorting,
docgenoutput depends on undefined map iteration order, which can vary across Go versions and builds.Requirements