Skip to content

Conversation

@brizzinck
Copy link
Member

No description provided.

@brizzinck brizzinck self-assigned this Jul 6, 2025

This comment was marked as outdated.

@brizzinck brizzinck requested a review from Copilot July 6, 2025 20:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the YaCache API to change how multi-key fetches (MGet) and existence checks (Exists) behave and are surfaced to callers.

  • MGet now returns map[string]*string (nil for missing values) instead of failing the entire operation.
  • Exists accepts multiple keys and returns true only if all specified keys exist.
  • Redis and memory backends, along with their tests, are updated to match the new signatures and behaviors.

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
yacache/yacache.go Updated interface docs and signatures for MGet and Exists
yacache/redis.go Changed MGet to return *string values; updated Exists to varargs
yacache/memory.go Mirrored MGet and Exists signature and behavior changes
yacache/redis_test.go Adjusted tests for pointer-valued MGet and multi-key Exists
yacache/memory_test.go Adjusted tests for pointer-valued MGet
Comments suppressed due to low confidence (3)

yacache/yacache.go:208

  • The interface doc claims missing keys trigger an ErrFailedToMGetValues error, but implementations now return nil values per key without error. Please update the comment to match the actual behavior (nil entries for missing keys) or restore the all-or-nothing error behavior.
	// If any of the keys are missing or the operation fails,

yacache/memory.go:353

  • Add a doc comment above this method describing the new return type (map[string]*string) and that missing keys yield nil values rather than an error, mirroring the Redis implementation.
func (m *Memory) MGet(

yacache/redis_test.go:64

  • In Go, you cannot range directly over an integer. Change this loop to something like for i := 0; i < 10; i++ {}.
		for i := range 10 {

@YaCodesDevelopment YaCodesDevelopment merged commit 6b040ef into main Jul 6, 2025
1 check passed
@YaCodesDevelopment YaCodesDevelopment deleted the feature/yacache_native_hash_map branch July 6, 2025 22:53
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.

3 participants