v2.2.0: Model interface cleanup#10
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the model and sorter package interfaces/flags as part of a “model interface cleanup”, and adds a repository .gitignore.
Changes:
- Converted
sorter.SortFlagto a bitmask-style flag set and adjusted theSorterinterface (notablyReverse()signature). - Updated
model.ModelAPI (Filter/Map/Reduce signatures, addedGetData()andReverse(), and changedSetIDto return an error). - Added a root
.gitignore.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| sorter/sorter.go | Switches SortFlag to bit flags and updates the Sorter interface. |
| model/model.go | Renames/reorders ModelType constants and revises the Model interface methods/contracts. |
| .gitignore | Introduces ignore rules for Go/workspace artifacts and local tooling outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bdlm/std/sessions/7b912a44-cd8b-4ba6-897c-b5791ceb555c Co-authored-by: mkenney <477514+mkenney@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bdlm/std/sessions/7b912a44-cd8b-4ba6-897c-b5791ceb555c Co-authored-by: mkenney <477514+mkenney@users.noreply.github.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.
Added
model.Model.GetData()— returns snapshots of the data set and key/index maps; implementations must not expose internal storage directlymodel.Model.Reverse()— reverses the order of the data storesorter.SortByValue— zero-valueSortFlag; type-stratified sort (nil < bool < numeric < string < other); now the default sort behaviorsorter.SortAsc,SortDesc,SortAsString,SortReverse— explicit bitflag sort options.gitignoreChanged
model.ModelTypeHash/model.ModelTypeListrenamed tomodel.HASH/model.LIST; order swapped soHASHis the zero/iota valuemodel.Model.Filtercallback signature changed fromfunc(Value) Modeltofunc(Value) boolmodel.Model.Mapcallback signature changed fromfunc(Value) Modeltofunc(Value) Valuemodel.Model.Reducecallback signature changed fromfunc(Value) booltofunc(carry, cur Value) Value(standard fold semantics)model.Model.SetIDnow returnserrorsorter.SortFlagunderlying type changed frominttouintsorter.Sorter.Reversesignature changed fromReverse(SortFlag) errortoReverse() errorFixed
errors/error.gopackage declaration corrected frompackage errortopackage errors