Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: update comments for named provider related function #213

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/openfeature/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (api *evaluationAPI) setNamedProvider(clientName string, provider FeaturePr
return errors.New("provider cannot be set to nil")
}

// Initialize new default provider and shutdown the old one
// Initialize new named provider and shutdown the old one
// Provider update must be non-blocking, hence initialization & shutdown happens concurrently
oldProvider := api.namedProviders[clientName]
api.namedProviders[clientName] = provider
Expand All @@ -89,7 +89,7 @@ func (api *evaluationAPI) setNamedProvider(clientName string, provider FeaturePr
return nil
}

// getNamedProviders return default providers
// getNamedProviders returns named providers map.
func (api *evaluationAPI) getNamedProviders() map[string]FeatureProvider {
api.mu.RLock()
defer api.mu.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion pkg/openfeature/openfeature.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func getProvider() FeatureProvider {
return api.getProvider()
}

// getNamedProviders returns the default provider of the API. Intended to be used by tests
// getNamedProviders returns the named provider map of the API. Intended to be used by tests
func getNamedProviders() map[string]FeatureProvider {
return api.getNamedProviders()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/openfeature/openfeature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestRequirement_1_1_2_3(t *testing.T) {
select {
// short enough wait time, but not too long
case <-time.After(100 * time.Millisecond):
t.Errorf("shutdown not invoked for old default provider when registering new provider")
t.Errorf("shutdown not invoked for old named provider when registering new provider")
case <-shutdownSem:
break
}
Expand Down