-
Notifications
You must be signed in to change notification settings - Fork 0
release: 0.7.0 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: 0.7.0 #17
Conversation
628234a to
8e438e1
Compare
| for _, key := range keys { | ||
| if key == "#" { | ||
| key = strconv.Itoa(len(gjson.GetBytes(json, path).Array()) - 1) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Empty array causes negative index in path resolution
When the path contains # (representing the last array element) and the target array is empty, len(gjson.GetBytes(json, path).Array()) - 1 evaluates to -1. This produces an invalid path like items.-1 which will cause unexpected behavior when passed to sjson.SetBytes.
| parsed = any(timeVal).(T) | ||
| case any: | ||
| // For `any`, store the string value directly | ||
| parsed = any(val).(T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Type switch unreachable for any type parameter
The case any: branch in the type switch is unreachable. When T is instantiated with any, the zero value of parsed is nil, and a type switch on nil doesn't match case any:. This causes JSONAnyFlag to always fall through to default: and return "unsupported type for JSON flag" error, making the type unusable.
| } | ||
| // For any flags with SetValue, register the configured value | ||
| globalRegistry.Mutate(v.config.Kind, v.config.Path, v.config.SetValue) | ||
| *v.destination = any(v.config.SetValue).(T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Unchecked type assertion may panic at runtime
The type assertion any(v.config.SetValue).(T) will panic at runtime if SetValue is not exactly of type T. For instance, if a JSONIntFlag is configured with SetValue of type int64 instead of int, the assertion fails and causes a panic. A type-safe check or conversion is needed.
| return base64.StdEncoding.EncodeToString(buf.Bytes()) | ||
| } | ||
| return buf.String() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Reader consumed on first access returns empty thereafter
The fileReader.String() method calls buf.ReadFrom(f.Value) which fully consumes the underlying io.Reader. Since Get() delegates to String(), any subsequent call to either method returns an empty string. CLI frameworks often access flag values multiple times (for help text, validation, actual usage), causing silent data loss after the first read.
8e438e1 to
d3759e2
Compare
d3759e2 to
cc35fa1
Compare
|
🤖 Release is at https://github.com/onkernel/hypeman-cli/releases/tag/v0.7.0 🌻 |
Automated Release PR
0.7.0 (2025-12-23)
Full Changelog: v0.6.1...v0.7.0
Features
Chores
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
Release 0.7.0
cpcommand for file copy to/from instancespkg/jsonflagframework (with tests) to mutate requestbody,query, andheadervia CLI flags; includes date/datetime parsing helperspkg/cmd/util.gohelpers:fileReader, stdin JSON merging with flags, and HTTP debug middleware0.7.0, refreshesCHANGELOG.md, and adds directgithub.com/tidwall/sjsondependencyWritten by Cursor Bugbot for commit cc35fa1. This will update automatically on new commits. Configure here.