Skip to content

chore: Better abstraction - #1

Merged
gocanto merged 6 commits into
mainfrom
chore/format
Mar 31, 2026
Merged

gocanto merged 6 commits into
mainfrom
chore/format

Conversation

@gocanto

@gocanto gocanto commented Mar 29, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements widespread formatting updates across the arr, collection, and kv packages, primarily adding vertical whitespace to improve the readability of logic blocks and test cases. Additionally, it introduces a new go-fmt.compose.yaml file to facilitate the use of the go-fmt tool via Docker Compose. I have no feedback to provide.

@gocanto gocanto changed the title format chore: Abstraction Mar 29, 2026
@gocanto gocanto changed the title chore: Abstraction chore: Better abstraction Mar 31, 2026
@gocanto
gocanto marked this pull request as ready for review March 31, 2026 07:45
@gocanto
gocanto merged commit e00c34b into main Mar 31, 2026
1 check passed
@gocanto
gocanto deleted the chore/format branch March 31, 2026 07:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7c3c3953e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread collection/combine.go

// Combine pairs of keys from this collection with values from the given slice,
// returning a collection of Pair values.
func Combine[K any, V any](keys *Collection[K], values []V) *Collection[support.Pair[K, V]] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve collection.Pair compatibility in Combine

Combine now returns *Collection[support.Pair[K, V]], but the collection.Pair type that callers previously depended on is no longer exposed in this package. Any downstream code with APIs or type assertions built around collection.Pair will fail to compile after this upgrade even though the logical behavior of Combine is unchanged. Please keep a compatibility alias in collection (for example type Pair = support.Pair) so existing consumers can upgrade without breaking.

Useful? React with 👍 / 👎.

Comment thread collection/access.go
if !ok {
var zero T

return zero, &support.ItemNotFoundError{}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep collection error types available to callers

FirstOrFail (and similarly Sole) now returns support.* error types, while collection.ItemNotFoundError/collection.MultipleItemsFoundError are no longer available from the original package. This is a breaking change for callers that match these concrete error types (for example with errors.As) or reference them directly, and it will surface as downstream compile/runtime compatibility breakage. Please re-export aliases from collection to preserve existing error contracts.

Useful? React with 👍 / 👎.

Comment thread collection/collection.go
Comment on lines +155 to +156
// PairIter returns an iter.Seq2[int, T] that yields each index-item pair in the collection.
func (c *Collection[T]) PairIter() iter.Seq2[int, T] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore Iter2 alias for backward compatibility

The indexed iterator method was renamed to PairIter, but the previously exported Iter2 method was removed. Existing clients using c.Iter2() will fail to compile after upgrading, even though the underlying behavior is identical. Keeping a deprecated Iter2 wrapper that forwards to PairIter would avoid this unnecessary API break.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant