string) (*Response, bool, error) { if record, exists := a.cache.get(token); exists { return record.resp, record.ok, record.err } record, _, _ := a.group.Do(token, func() (interface{}, error) { resp, ok, err := a.authenticator.AuthenticateToken(ctx, token) record := &cacheRecord{resp, ok, err} a.cache.set(token, record, defaultTTL) return record, nil }) realRecord := record.(*cacheRecord) return realRecord.resp, realRecord.ok, realRecord.err }