Skip to content

Support whether the returned value was cached or not #61

Open

Description

@gabriel

There is no way to know if a returned value was the result of the call or a cached result? This is useful to know in certain circumstances.

Something like:

// SomeMethod ... and also returns whether the value was cached result or not
func (g *Group) SomeMethod(key string, fn func() (interface{}, error)) (interface{}, bool, error) {

In the case of cached lookup the returned bool is true.

Activity

  1. dineshappavoo commented on Apr 15, 2016

    @dineshappavoo

    @gabriel @bradfitz Hi, Is there anyone working on this enhancement. I am really interested contributing to this project. I thought I could contribute to this requirement. Can we chat about this? Is there any chat group for this project?

  2. bradfitz commented on Jun 29, 2016

    @bradfitz
    Contributor

    There is no chat group for this project, and it's largely frozen. People use this and it works, but nobody is particularly interested in adding features (which has a cost in terms of maintenance and updating code)

    If it's not very invasive, we could consider it, though.

  3. added a commit that references this issue on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions