chore: better code doc. and CodeUnset rename#5
Merged
Conversation
Rename `NoCode` to `CodeUnset` to better reflect its purpose as the default unset value for Code type. Add comprehensive documentation to exported types and functions in the package, improving code clarity and maintainability.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR renames the default NoCode constant to CodeUnset for clarity and adds comprehensive documentation to exported types and functions.
- Renamed
NoCodetoCodeUnsetthroughout code and tests - Updated formatter logic to use
CodeUnset - Added doc comments for
With,Op,GetOpStack,CodeUnset, andGetCode
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| with.go | Added doc comment for With function |
| op.go | Documented Op type and GetOpStack function |
| formatter.go | Switched writeCode to check CodeUnset instead of NoCode |
| code_test.go | Updated test to expect CodeUnset instead of NoCode |
| code.go | Renamed NoCode to CodeUnset and added documentation |
Comments suppressed due to low confidence (1)
code_test.go:12
- Update the error message to reference
CodeUnsetinstead ofNoCodeto match the renamed constant.
t.Error("expected NoCode, got", errors.GetCode(err))
xico42
approved these changes
Jun 17, 2025
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.
Rename
NoCodetoCodeUnsetto better reflect its purpose as the default unset value for Code type.Add comprehensive documentation to exported types and functions in the package, improving code clarity and maintainability.