Skip to content

Commit 95c9d16

Browse files
pass configurationStore by reference (#9)
1 parent a3e5794 commit 95c9d16

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

eppoclient/configurationrequestor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ type iConfigRequestor interface {
1414

1515
type experimentConfigurationRequestor struct {
1616
httpClient httpClient
17-
configStore configurationStore
17+
configStore *configurationStore
1818
}
1919

20-
func newExperimentConfigurationRequestor(httpClient httpClient, configStore configurationStore) *experimentConfigurationRequestor {
20+
func newExperimentConfigurationRequestor(httpClient httpClient, configStore *configurationStore) *experimentConfigurationRequestor {
2121
return &experimentConfigurationRequestor{
2222
httpClient: httpClient,
2323
configStore: configStore,

eppoclient/configurationstore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
type configurationStore struct {
12-
cache lru.Cache
12+
cache *lru.Cache
1313
}
1414

1515
type Variation struct {
@@ -31,7 +31,7 @@ func newConfigurationStore(maxEntries int) *configurationStore {
3131
var configStore = &configurationStore{}
3232

3333
lruCache, err := lru.New(maxEntries)
34-
configStore.cache = *lruCache
34+
configStore.cache = lruCache
3535

3636
if err != nil {
3737
panic(err)

eppoclient/initclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func InitClient(config Config) *EppoClient {
1414

1515
httpClient := newHttpClient(config.BaseUrl, &http.Client{Timeout: REQUEST_TIMEOUT_SECONDS}, sdkParams)
1616
configStore := newConfigurationStore(MAX_CACHE_ENTRIES)
17-
requestor := newExperimentConfigurationRequestor(*httpClient, *configStore)
17+
requestor := newExperimentConfigurationRequestor(*httpClient, configStore)
1818
assignmentLogger := NewAssignmentLogger()
1919

2020
client := newEppoClient(requestor, assignmentLogger)

0 commit comments

Comments
 (0)