From 19b4c182372a8937c9aa4545117cb03b0ff5526f Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Thu, 18 Jan 2024 20:42:57 +0600 Subject: [PATCH 1/4] update readme, changelog & license year --- CHANGELOG.MD | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 2 +- README.md | 29 ++++++++++++++++++----------- 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index ee49f7514..84df28729 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,54 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] Changes that have landed but are not yet released. +## [2.0.0] - January 19th, 2024 + +### New Features + +The 2.0.0 release introduces a new primary feature, [Advanced Audience Targeting]( https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-data-platform-advanced-audience-targeting) enabled through integration with [Optimizely Data Platform (ODP)](https://docs.developers.optimizely.com/optimizely-data-platform/docs) ([#350](https://github.com/optimizely/go-sdk/pull/350), [#353](https://github.com/optimizely/go-sdk/pull/353), [#354](https://github.com/optimizely/go-sdk/pull/354), [#355](https://github.com/optimizely/go-sdk/pull/355)). + +You can use ODP, a high-performance [Customer Data Platform (CDP)]( https://www.optimizely.com/optimization-glossary/customer-data-platform/), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool. + +With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Optimizely Customer Success Manager. + +This version includes the following changes: + +* New API added to `OptimizelyUserContext`: + + - `FetchQualifiedSegments()`: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays. + + - When an `OptimizelyUserContext` is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities. + +* New APIs added to `OptimizelyClient`: + + - `SendOdpEvent()`: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP. + +The release also introduces basic OpenTelemetry tracing on Client methods. ([#385](https://github.com/optimizely/go-sdk/pull/385)) + +* New ClientOptionFunc `WithTracer()` is added to initiate OptimizelyClient with OpenTelemetry tracer. + +* New method `WithTraceContext()` is added to `OptimizelyClient` & `OptimizelyUserContext` to pass the trace context while calling APIs. + +For details, refer to our documentation pages: + +* [Advanced Audience Targeting](https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-data-platform-advanced-audience-targeting) + +* [Server SDK Support](https://docs.developers.optimizely.com/feature-experimentation/v1.0/docs/advanced-audience-targeting-for-server-side-sdks) + +* [Initialize Go SDK](https://docs.developers.optimizely.com/feature-experimentation/docs/initialize-sdk-go) + +* [OptimizelyUserContext Go SDK](https://docs.developers.optimizely.com/feature-experimentation/docs/optimizelyusercontext-go) + +* [Advanced Audience Targeting segment qualification methods](https://docs.developers.optimizely.com/feature-experimentation/v1.0/docs/advanced-audience-targeting-segment-qualification-methods-go) + +* [Send Optimizely Data Platform data using Advanced Audience Targeting](https://docs.developers.optimizely.com/feature-experimentation/v1.0/docs/send-odp-data-using-advanced-audience-targeting-go) + +### Breaking Changes + +* ODPManager in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, most ODPManager functions will be ignored. If needed, ODPManager can be disabled when `OptimizelyClient` is instantiated. +* Minimum golang version changed from 1.13 to 1.21.0. ([#369](https://github.com/optimizely/go-sdk/pull/369), [#380](https://github.com/optimizely/go-sdk/pull/380)) + + ## [1.8.5] - October 5th, 2023 * Fixed a bug in the HTTP Requester logging. Now correct error message is logged. ([#374](https://github.com/optimizely/go-sdk/pull/374)) diff --git a/LICENSE b/LICENSE index b9f80c5bd..c9f7279d1 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2017, Optimizely, Inc. and contributors + Copyright 2016-2024, Optimizely, Inc. and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 87c93edc6..088245ae9 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,23 @@ Refer to the [Go SDK's developer documentation](https://docs.developers.optimize ### Requirements -Requires Golang version 1.19 or higher. +Requires Golang version: + +- For v2: 1.21.0 or higher +- For < v2: 1.12 or higher ### Install the SDK #### Install from github: ```$sh -go get github.com/optimizely/go-sdk +go get github.com/optimizely/go-sdk/v2 ``` #### Install from source: ```$sh -go get github.com/optimizely/go-sdk -cd $GOPATH/src/github.com/optimizely/go-sdk +go get github.com/optimizely/go-sdk/v2 +cd $GOPATH/src/github.com/optimizely/go-sdk/v2 go install ``` @@ -44,23 +47,23 @@ module mymodule go 1.21.0 require ( - github.com/optimizely/go-sdk v2.0.0-beta + github.com/optimizely/go-sdk/v2 v2.0.0 ) ``` If you are already using `go.mod` in your application you can run the following: ``` -go mod edit -require github.com/optimizely/go-sdk@v2.0.0-beta +go mod edit -require github.com/optimizely/go-sdk/v2@v2.0.0 ``` NOTE: ```$sh -go get github.com/optimizely/go-sdk/... +go get github.com/optimizely/go-sdk/v2/... ``` or ```$sh -go get github.com/optimizely/go-sdk/pkg +go get github.com/optimizely/go-sdk/v2/pkg ``` will install it as a package to pkg directory, rather than src directory. It could be useful for future development and vendoring. @@ -72,8 +75,8 @@ See the example file in examples/main.go. ### Initialization ``` -import optly "github.com/optimizely/go-sdk" -import "github.com/optimizely/go-sdk/client" +import optly "github.com/optimizely/go-sdk/v2" +import "github.com/optimizely/go-sdk/v2/client" // Simple one-line initialization with the SDK key    optlyClient, err := optly.Client("SDK_KEY")    @@ -87,7 +90,7 @@ optlyClient, err = optimizelyFactory.Client() ### Make Decisions ``` import ( - optly "github.com/optimizely/go-sdk" + optly "github.com/optimizely/go-sdk/v2" ) // instantiate a client @@ -161,6 +164,10 @@ sync Copyright (c) 2009 The Go Authors. All rights reserved. https://github.com/golang/sync/blob/master/LICENSE +opentelemetry-go +Copyright The OpenTelemetry Authors +License (Apache-2.0): https://github.com/open-telemetry/opentelemetry-go/blob/main/LICENSE + ### Other Optimizely SDKs - Agent - https://github.com/optimizely/agent From d51a3b1b163195df63f18bc61fd6bba264723d30 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 19 Jan 2024 00:20:22 +0600 Subject: [PATCH 2/4] update changelog --- CHANGELOG.MD | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 84df28729..c79a7982f 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -28,14 +28,8 @@ This version includes the following changes: * New APIs added to `OptimizelyClient`: - `SendOdpEvent()`: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP. - -The release also introduces basic OpenTelemetry tracing on Client methods. ([#385](https://github.com/optimizely/go-sdk/pull/385)) -* New ClientOptionFunc `WithTracer()` is added to initiate OptimizelyClient with OpenTelemetry tracer. - -* New method `WithTraceContext()` is added to `OptimizelyClient` & `OptimizelyUserContext` to pass the trace context while calling APIs. - -For details, refer to our documentation pages: +For details, refer to our documentation pages: * [Advanced Audience Targeting](https://docs.developers.optimizely.com/feature-experimentation/docs/optimizely-data-platform-advanced-audience-targeting) @@ -54,6 +48,18 @@ For details, refer to our documentation pages: * ODPManager in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, most ODPManager functions will be ignored. If needed, ODPManager can be disabled when `OptimizelyClient` is instantiated. * Minimum golang version changed from 1.13 to 1.21.0. ([#369](https://github.com/optimizely/go-sdk/pull/369), [#380](https://github.com/optimizely/go-sdk/pull/380)) +### Bug Fixes +* Logged correct error message in HTTP requests. ([#374](https://github.com/optimizely/go-sdk/pull/374)) +* Stopped all tickers to prevent goroutine leak. ([#375](https://github.com/optimizely/go-sdk/pull/375)). +* Client is closed gracefully to dispatch queued events. ([#376](https://github.com/optimizely/go-sdk/pull/376)) +* Convert warning into error log for SyncConfig failure. ([#383](https://github.com/optimizely/go-sdk/pull/383)) + +### Functionality Enhancement +* Github issue template is updated. ([#379](https://github.com/optimizely/go-sdk/pull/379)) +* Helper function for passing notification center is added. ([#381](https://github.com/optimizely/go-sdk/pull/381)) +* OpenTelemetry tracing support is added. ([#385](https://github.com/optimizely/go-sdk/pull/385)) + - New ClientOptionFunc `WithTracer()` is added to initiate `OptimizelyClient` with OpenTelemetry tracer. + - New method `WithTraceContext()` is added to `OptimizelyClient` to set the trace context before calling APIs. ## [1.8.5] - October 5th, 2023 From fab28576708ad0b5591065623fbb77e736aa6f55 Mon Sep 17 00:00:00 2001 From: pulak-opti Date: Fri, 19 Jan 2024 00:42:36 +0600 Subject: [PATCH 3/4] update module name --- README.md | 7 +++-- examples/benchmark/main.go | 6 ++-- examples/main.go | 8 +++--- go.mod | 2 +- optimizely.go | 4 +-- pkg/client/client.go | 28 +++++++++---------- pkg/client/client_test.go | 24 ++++++++-------- pkg/client/factory.go | 24 ++++++++-------- pkg/client/factory_test.go | 28 +++++++++---------- pkg/client/fixtures_test.go | 12 ++++---- pkg/client/optimizely_decision.go | 2 +- pkg/client/optimizely_decision_test.go | 2 +- pkg/client/optimizely_user_context.go | 8 +++--- .../optimizely_user_context_odp_test.go | 10 +++---- pkg/client/optimizely_user_context_test.go | 12 ++++---- pkg/config/datafileprojectconfig/config.go | 6 ++-- .../datafileprojectconfig/config_test.go | 4 +-- .../entities/entities.go | 2 +- .../datafileprojectconfig/json_parser.go | 4 +-- .../datafileprojectconfig/json_parser_test.go | 2 +- .../mappers/attribute.go | 4 +-- .../mappers/attribute_test.go | 4 +-- .../datafileprojectconfig/mappers/audience.go | 4 +-- .../mappers/audience_test.go | 4 +-- .../mappers/condition_trees.go | 4 +-- .../mappers/condition_trees_test.go | 4 +-- .../datafileprojectconfig/mappers/events.go | 4 +-- .../mappers/events_test.go | 4 +-- .../mappers/experiment.go | 4 +-- .../mappers/experiment_test.go | 4 +-- .../datafileprojectconfig/mappers/feature.go | 4 +-- .../mappers/feature_test.go | 4 +-- .../mappers/forced_decision.go | 2 +- .../datafileprojectconfig/mappers/group.go | 4 +-- .../mappers/group_test.go | 4 +-- .../datafileprojectconfig/mappers/rollout.go | 4 +-- .../mappers/rollout_test.go | 4 +-- pkg/config/interface.go | 4 +-- pkg/config/optimizely_config.go | 4 +-- pkg/config/polling_manager.go | 10 +++---- pkg/config/polling_manager_test.go | 8 +++--- pkg/config/static_manager.go | 8 +++--- pkg/config/static_manager_test.go | 6 ++-- pkg/decision/bucketer/experiment_bucketer.go | 6 ++-- .../bucketer/experiment_bucketer_test.go | 7 +++-- pkg/decision/bucketer/murmurhashbucketer.go | 4 +-- .../bucketer/murmurhashbucketer_test.go | 5 ++-- pkg/decision/composite_experiment_service.go | 6 ++-- .../composite_experiment_service_test.go | 6 ++-- pkg/decision/composite_feature_service.go | 6 ++-- .../composite_feature_service_test.go | 8 +++--- pkg/decision/composite_service.go | 10 +++---- pkg/decision/composite_service_test.go | 6 ++-- pkg/decision/entities.go | 6 ++-- pkg/decision/evaluator/condition.go | 8 +++--- pkg/decision/evaluator/condition_test.go | 8 +++--- pkg/decision/evaluator/condition_tree.go | 6 ++-- pkg/decision/evaluator/condition_tree_test.go | 6 ++-- pkg/decision/evaluator/matchers/exact.go | 6 ++-- pkg/decision/evaluator/matchers/exact_test.go | 4 +-- pkg/decision/evaluator/matchers/exists.go | 4 +-- .../evaluator/matchers/exists_test.go | 2 +- pkg/decision/evaluator/matchers/ge.go | 6 ++-- pkg/decision/evaluator/matchers/ge_test.go | 2 +- pkg/decision/evaluator/matchers/gt.go | 6 ++-- pkg/decision/evaluator/matchers/gt_test.go | 4 +-- pkg/decision/evaluator/matchers/le.go | 6 ++-- pkg/decision/evaluator/matchers/le_test.go | 2 +- pkg/decision/evaluator/matchers/lt.go | 4 +-- pkg/decision/evaluator/matchers/lt_test.go | 4 +-- pkg/decision/evaluator/matchers/qualified.go | 4 +-- .../evaluator/matchers/qualified_test.go | 4 +-- pkg/decision/evaluator/matchers/registry.go | 4 +-- .../evaluator/matchers/registry_test.go | 4 +-- pkg/decision/evaluator/matchers/semver.go | 6 ++-- .../evaluator/matchers/semver_test.go | 2 +- pkg/decision/evaluator/matchers/substring.go | 4 +-- .../evaluator/matchers/substring_test.go | 4 +-- pkg/decision/experiment_bucketer_service.go | 12 ++++---- .../experiment_bucketer_service_test.go | 8 +++--- pkg/decision/experiment_override_service.go | 8 +++--- .../experiment_override_service_test.go | 8 +++--- pkg/decision/experiment_whitelist_service.go | 6 ++-- .../experiment_whitelist_service_test.go | 6 ++-- pkg/decision/feature_experiment_service.go | 6 ++-- .../feature_experiment_service_test.go | 6 ++-- pkg/decision/feature_notification.go | 4 +-- pkg/decision/feature_notification_test.go | 4 +-- pkg/decision/flag_notification.go | 4 +-- pkg/decision/forced_decision_service.go | 6 ++-- pkg/decision/forced_decision_service_test.go | 4 +-- pkg/decision/helpers_test.go | 6 ++-- pkg/decision/interface.go | 6 ++-- pkg/decision/persisting_experiment_service.go | 6 ++-- .../persisting_experiment_service_test.go | 6 ++-- pkg/decision/rollout_service.go | 10 +++---- pkg/decision/rollout_service_test.go | 10 +++---- pkg/entities/user_context.go | 2 +- pkg/event/dispatcher.go | 6 ++-- pkg/event/dispatcher_test.go | 4 +-- pkg/event/factory.go | 8 +++--- pkg/event/factory_test.go | 6 ++-- pkg/event/processor.go | 8 +++--- pkg/event/processor_test.go | 4 +-- pkg/event/queue.go | 2 +- pkg/notification/center.go | 3 +- pkg/notification/center_test.go | 2 +- pkg/notification/entities.go | 2 +- pkg/notification/manager.go | 2 +- pkg/notification/manager_test.go | 2 +- pkg/odp/config/config.go | 2 +- pkg/odp/event/event_api_manager.go | 6 ++-- pkg/odp/event/event_api_manager_test.go | 4 +-- pkg/odp/event/event_manager.go | 8 +++--- pkg/odp/event/event_manager_test.go | 10 +++---- pkg/odp/odp_manager.go | 12 ++++---- pkg/odp/odp_manager_test.go | 10 +++---- pkg/odp/segment/segment_api_manager.go | 6 ++-- pkg/odp/segment/segment_api_manager_test.go | 6 ++-- pkg/odp/segment/segment_manager.go | 4 +-- pkg/odp/segment/segment_manager_test.go | 2 +- pkg/odp/utils/utils.go | 2 +- pkg/registry/service.go | 2 +- pkg/utils/execgroup.go | 3 +- pkg/utils/execgroup_test.go | 3 +- pkg/utils/requester.go | 2 +- pkg/utils/requester_test.go | 2 +- 127 files changed, 375 insertions(+), 367 deletions(-) diff --git a/README.md b/README.md index 088245ae9..e4d00c32c 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,11 @@ Refer to the [Go SDK's developer documentation](https://docs.developers.optimize Requires Golang version: -- For v2: 1.21.0 or higher -- For < v2: 1.12 or higher +| SDK Version | Required Golang Version | +|--------------|--------------------------| +| v2.0.0 | 1.21.0 or higher | +| < v2.0.0 | 1.13 or higher | + ### Install the SDK diff --git a/examples/benchmark/main.go b/examples/benchmark/main.go index 74cddfd1c..41785ef90 100644 --- a/examples/benchmark/main.go +++ b/examples/benchmark/main.go @@ -9,9 +9,9 @@ import ( "github.com/pkg/profile" - "github.com/optimizely/go-sdk/pkg/client" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/client" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) func stressTest() { diff --git a/examples/main.go b/examples/main.go index db786345a..516230b80 100644 --- a/examples/main.go +++ b/examples/main.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - optimizely "github.com/optimizely/go-sdk" - "github.com/optimizely/go-sdk/pkg/client" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" + optimizely "github.com/optimizely/go-sdk/v2" + "github.com/optimizely/go-sdk/v2/pkg/client" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) func main() { diff --git a/go.mod b/go.mod index 3694117e6..b6385c52a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/optimizely/go-sdk +module github.com/optimizely/go-sdk/v2 go 1.21.0 diff --git a/optimizely.go b/optimizely.go index db340eb06..7018bbdf2 100644 --- a/optimizely.go +++ b/optimizely.go @@ -17,8 +17,8 @@ package optimizely import ( - "github.com/optimizely/go-sdk/pkg/client" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/client" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // Client returns an OptimizelyClient instantiated with the given key and options diff --git a/pkg/client/client.go b/pkg/client/client.go index 33631e6ed..8c411b233 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -28,20 +28,20 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/odp" - pkgOdpSegment "github.com/optimizely/go-sdk/pkg/odp/segment" - pkgOdpUtils "github.com/optimizely/go-sdk/pkg/odp/utils" - "github.com/optimizely/go-sdk/pkg/optimizelyjson" - "github.com/optimizely/go-sdk/pkg/tracing" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/odp" + pkgOdpSegment "github.com/optimizely/go-sdk/v2/pkg/odp/segment" + pkgOdpUtils "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/optimizelyjson" + "github.com/optimizely/go-sdk/v2/pkg/tracing" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) const ( diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index eb9a40f51..0bc37a6f2 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -29,18 +29,18 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/odp" - "github.com/optimizely/go-sdk/pkg/odp/segment" - pkgOdpUtils "github.com/optimizely/go-sdk/pkg/odp/utils" - "github.com/optimizely/go-sdk/pkg/tracing" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/odp" + "github.com/optimizely/go-sdk/v2/pkg/odp/segment" + pkgOdpUtils "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/tracing" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) func ValidProjectConfigManager() *MockProjectConfigManager { diff --git a/pkg/client/factory.go b/pkg/client/factory.go index 1f28e10d9..fd9d62ed1 100644 --- a/pkg/client/factory.go +++ b/pkg/client/factory.go @@ -22,18 +22,18 @@ import ( "errors" "time" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/metrics" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/odp" - pkgUtils "github.com/optimizely/go-sdk/pkg/odp/utils" - "github.com/optimizely/go-sdk/pkg/registry" - "github.com/optimizely/go-sdk/pkg/tracing" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/metrics" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/odp" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/registry" + "github.com/optimizely/go-sdk/v2/pkg/tracing" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) // OptimizelyFactory is used to customize and construct an instance of the OptimizelyClient. diff --git a/pkg/client/factory_test.go b/pkg/client/factory_test.go index dd6765519..3633659fd 100644 --- a/pkg/client/factory_test.go +++ b/pkg/client/factory_test.go @@ -27,20 +27,20 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/metrics" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/odp" - "github.com/optimizely/go-sdk/pkg/odp/cache" - pkgOdpEvent "github.com/optimizely/go-sdk/pkg/odp/event" - pkgOdpSegment "github.com/optimizely/go-sdk/pkg/odp/segment" - pkgOdpUtils "github.com/optimizely/go-sdk/pkg/odp/utils" - "github.com/optimizely/go-sdk/pkg/registry" - "github.com/optimizely/go-sdk/pkg/tracing" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/metrics" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/odp" + "github.com/optimizely/go-sdk/v2/pkg/odp/cache" + pkgOdpEvent "github.com/optimizely/go-sdk/v2/pkg/odp/event" + pkgOdpSegment "github.com/optimizely/go-sdk/v2/pkg/odp/segment" + pkgOdpUtils "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/registry" + "github.com/optimizely/go-sdk/v2/pkg/tracing" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) type MockRequester struct { diff --git a/pkg/client/fixtures_test.go b/pkg/client/fixtures_test.go index 109934085..12e8a855d 100644 --- a/pkg/client/fixtures_test.go +++ b/pkg/client/fixtures_test.go @@ -20,12 +20,12 @@ package client import ( "fmt" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/notification" "github.com/stretchr/testify/mock" ) diff --git a/pkg/client/optimizely_decision.go b/pkg/client/optimizely_decision.go index 719832ceb..588e7cb50 100644 --- a/pkg/client/optimizely_decision.go +++ b/pkg/client/optimizely_decision.go @@ -18,7 +18,7 @@ package client import ( - "github.com/optimizely/go-sdk/pkg/optimizelyjson" + "github.com/optimizely/go-sdk/v2/pkg/optimizelyjson" ) // OptimizelyDecision defines the decision returned by decide api. diff --git a/pkg/client/optimizely_decision_test.go b/pkg/client/optimizely_decision_test.go index fe2c06cb4..69139f398 100644 --- a/pkg/client/optimizely_decision_test.go +++ b/pkg/client/optimizely_decision_test.go @@ -20,7 +20,7 @@ import ( "errors" "testing" - "github.com/optimizely/go-sdk/pkg/optimizelyjson" + "github.com/optimizely/go-sdk/v2/pkg/optimizelyjson" "github.com/stretchr/testify/suite" ) diff --git a/pkg/client/optimizely_user_context.go b/pkg/client/optimizely_user_context.go index 05cedbce1..1b5922471 100644 --- a/pkg/client/optimizely_user_context.go +++ b/pkg/client/optimizely_user_context.go @@ -21,10 +21,10 @@ import ( "errors" "sync" - "github.com/optimizely/go-sdk/pkg/decide" - pkgDecision "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" - pkgOdpSegment "github.com/optimizely/go-sdk/pkg/odp/segment" + "github.com/optimizely/go-sdk/v2/pkg/decide" + pkgDecision "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" + pkgOdpSegment "github.com/optimizely/go-sdk/v2/pkg/odp/segment" ) // OptimizelyUserContext defines user contexts that the SDK will use to make decisions for. diff --git a/pkg/client/optimizely_user_context_odp_test.go b/pkg/client/optimizely_user_context_odp_test.go index 522831183..56082ed7e 100644 --- a/pkg/client/optimizely_user_context_odp_test.go +++ b/pkg/client/optimizely_user_context_odp_test.go @@ -26,11 +26,11 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp" - "github.com/optimizely/go-sdk/pkg/odp/event" - "github.com/optimizely/go-sdk/pkg/odp/segment" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp" + "github.com/optimizely/go-sdk/v2/pkg/odp/event" + "github.com/optimizely/go-sdk/v2/pkg/odp/segment" ) type OptimizelyUserContextODPTestSuite struct { diff --git a/pkg/client/optimizely_user_context_test.go b/pkg/client/optimizely_user_context_test.go index ed76c4fc0..e85fe676d 100644 --- a/pkg/client/optimizely_user_context_test.go +++ b/pkg/client/optimizely_user_context_test.go @@ -25,12 +25,12 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/optimizelyjson" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/optimizelyjson" ) var doOnce sync.Once // required since we only need to read datafile once diff --git a/pkg/config/datafileprojectconfig/config.go b/pkg/config/datafileprojectconfig/config.go index 925422b3b..c825cc62b 100644 --- a/pkg/config/datafileprojectconfig/config.go +++ b/pkg/config/datafileprojectconfig/config.go @@ -21,9 +21,9 @@ import ( "errors" "fmt" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/mappers" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/mappers" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) var datafileVersions = map[string]struct{}{ diff --git a/pkg/config/datafileprojectconfig/config_test.go b/pkg/config/datafileprojectconfig/config_test.go index 475fc0d59..3ed96665b 100644 --- a/pkg/config/datafileprojectconfig/config_test.go +++ b/pkg/config/datafileprojectconfig/config_test.go @@ -24,8 +24,8 @@ import ( "path/filepath" "testing" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/entities/entities.go b/pkg/config/datafileprojectconfig/entities/entities.go index 5ae123571..abc6e8dfa 100644 --- a/pkg/config/datafileprojectconfig/entities/entities.go +++ b/pkg/config/datafileprojectconfig/entities/entities.go @@ -17,7 +17,7 @@ // Package entities has entity definitions package entities -import "github.com/optimizely/go-sdk/pkg/entities" +import "github.com/optimizely/go-sdk/v2/pkg/entities" // Audience represents an Audience object from the Optimizely datafile type Audience struct { diff --git a/pkg/config/datafileprojectconfig/json_parser.go b/pkg/config/datafileprojectconfig/json_parser.go index 1df3e33c0..1bfa14892 100644 --- a/pkg/config/datafileprojectconfig/json_parser.go +++ b/pkg/config/datafileprojectconfig/json_parser.go @@ -18,9 +18,9 @@ package datafileprojectconfig import ( - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" ) var json = jsoniter.ConfigCompatibleWithStandardLibrary diff --git a/pkg/config/datafileprojectconfig/json_parser_test.go b/pkg/config/datafileprojectconfig/json_parser_test.go index d27e96776..eeff1dd5c 100644 --- a/pkg/config/datafileprojectconfig/json_parser_test.go +++ b/pkg/config/datafileprojectconfig/json_parser_test.go @@ -21,7 +21,7 @@ import ( "os" "testing" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/attribute.go b/pkg/config/datafileprojectconfig/mappers/attribute.go index 915bd4ec4..3d0ad15bd 100644 --- a/pkg/config/datafileprojectconfig/mappers/attribute.go +++ b/pkg/config/datafileprojectconfig/mappers/attribute.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapAttributes maps the raw datafile attribute entities to SDK Attribute entities diff --git a/pkg/config/datafileprojectconfig/mappers/attribute_test.go b/pkg/config/datafileprojectconfig/mappers/attribute_test.go index 4eebc4b45..3cbcfebfc 100644 --- a/pkg/config/datafileprojectconfig/mappers/attribute_test.go +++ b/pkg/config/datafileprojectconfig/mappers/attribute_test.go @@ -19,8 +19,8 @@ package mappers import ( "testing" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/audience.go b/pkg/config/datafileprojectconfig/mappers/audience.go index 2a3eda2d1..7d638de01 100644 --- a/pkg/config/datafileprojectconfig/mappers/audience.go +++ b/pkg/config/datafileprojectconfig/mappers/audience.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapAudiences maps the raw datafile audience entities to SDK Audience entities diff --git a/pkg/config/datafileprojectconfig/mappers/audience_test.go b/pkg/config/datafileprojectconfig/mappers/audience_test.go index 51e2882da..53bde88c8 100644 --- a/pkg/config/datafileprojectconfig/mappers/audience_test.go +++ b/pkg/config/datafileprojectconfig/mappers/audience_test.go @@ -20,8 +20,8 @@ package mappers import ( "testing" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/condition_trees.go b/pkg/config/datafileprojectconfig/mappers/condition_trees.go index 849c3c1d5..8d56a86ca 100644 --- a/pkg/config/datafileprojectconfig/mappers/condition_trees.go +++ b/pkg/config/datafileprojectconfig/mappers/condition_trees.go @@ -22,8 +22,8 @@ import ( "reflect" jsoniter "github.com/json-iterator/go" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) var errEmptyTree = errors.New("empty tree") diff --git a/pkg/config/datafileprojectconfig/mappers/condition_trees_test.go b/pkg/config/datafileprojectconfig/mappers/condition_trees_test.go index 9bd18ca48..6e9323086 100644 --- a/pkg/config/datafileprojectconfig/mappers/condition_trees_test.go +++ b/pkg/config/datafileprojectconfig/mappers/condition_trees_test.go @@ -19,8 +19,8 @@ package mappers import ( "testing" - datafileConfig "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileConfig "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/events.go b/pkg/config/datafileprojectconfig/mappers/events.go index 63606ec2e..53ddbac70 100644 --- a/pkg/config/datafileprojectconfig/mappers/events.go +++ b/pkg/config/datafileprojectconfig/mappers/events.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapEvents maps the raw datafile event entities to SDK Event entities diff --git a/pkg/config/datafileprojectconfig/mappers/events_test.go b/pkg/config/datafileprojectconfig/mappers/events_test.go index 62f5788b4..075f71e59 100644 --- a/pkg/config/datafileprojectconfig/mappers/events_test.go +++ b/pkg/config/datafileprojectconfig/mappers/events_test.go @@ -19,8 +19,8 @@ package mappers import ( "testing" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/experiment.go b/pkg/config/datafileprojectconfig/mappers/experiment.go index e8efd8353..47d9544c4 100644 --- a/pkg/config/datafileprojectconfig/mappers/experiment.go +++ b/pkg/config/datafileprojectconfig/mappers/experiment.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapExperiments maps the raw experiments entities from the datafile to SDK Experiment entities and also returns a map of experiment key to experiment ID diff --git a/pkg/config/datafileprojectconfig/mappers/experiment_test.go b/pkg/config/datafileprojectconfig/mappers/experiment_test.go index 421c6a96c..a51088a2b 100644 --- a/pkg/config/datafileprojectconfig/mappers/experiment_test.go +++ b/pkg/config/datafileprojectconfig/mappers/experiment_test.go @@ -20,8 +20,8 @@ import ( "testing" jsoniter "github.com/json-iterator/go" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/feature.go b/pkg/config/datafileprojectconfig/mappers/feature.go index b7d1d3bf5..5514857c1 100644 --- a/pkg/config/datafileprojectconfig/mappers/feature.go +++ b/pkg/config/datafileprojectconfig/mappers/feature.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapFeatures maps the raw datafile feature flag entities to SDK Feature entities diff --git a/pkg/config/datafileprojectconfig/mappers/feature_test.go b/pkg/config/datafileprojectconfig/mappers/feature_test.go index d02eb9341..b5dc54ba8 100644 --- a/pkg/config/datafileprojectconfig/mappers/feature_test.go +++ b/pkg/config/datafileprojectconfig/mappers/feature_test.go @@ -20,8 +20,8 @@ import ( "testing" jsoniter "github.com/json-iterator/go" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/forced_decision.go b/pkg/config/datafileprojectconfig/mappers/forced_decision.go index e7fe0eeb4..164f510cf 100644 --- a/pkg/config/datafileprojectconfig/mappers/forced_decision.go +++ b/pkg/config/datafileprojectconfig/mappers/forced_decision.go @@ -18,7 +18,7 @@ package mappers import ( - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapFlagVariations all variations for each flag diff --git a/pkg/config/datafileprojectconfig/mappers/group.go b/pkg/config/datafileprojectconfig/mappers/group.go index ab9949470..dfa5ef2bd 100644 --- a/pkg/config/datafileprojectconfig/mappers/group.go +++ b/pkg/config/datafileprojectconfig/mappers/group.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapGroups maps the raw group entity from the datafile to an SDK Group entity diff --git a/pkg/config/datafileprojectconfig/mappers/group_test.go b/pkg/config/datafileprojectconfig/mappers/group_test.go index 6fed98fdb..4695cb340 100644 --- a/pkg/config/datafileprojectconfig/mappers/group_test.go +++ b/pkg/config/datafileprojectconfig/mappers/group_test.go @@ -19,8 +19,8 @@ package mappers import ( "testing" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/datafileprojectconfig/mappers/rollout.go b/pkg/config/datafileprojectconfig/mappers/rollout.go index 4e5f110d5..786e87c7d 100644 --- a/pkg/config/datafileprojectconfig/mappers/rollout.go +++ b/pkg/config/datafileprojectconfig/mappers/rollout.go @@ -18,8 +18,8 @@ package mappers import ( - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // MapRollouts maps the raw datafile rollout entities to SDK Rollout entities diff --git a/pkg/config/datafileprojectconfig/mappers/rollout_test.go b/pkg/config/datafileprojectconfig/mappers/rollout_test.go index 373dcb274..c4f29f119 100644 --- a/pkg/config/datafileprojectconfig/mappers/rollout_test.go +++ b/pkg/config/datafileprojectconfig/mappers/rollout_test.go @@ -19,8 +19,8 @@ package mappers import ( "testing" - datafileEntities "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/entities" - "github.com/optimizely/go-sdk/pkg/entities" + datafileEntities "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/interface.go b/pkg/config/interface.go index 3e74078c2..e6ee97769 100644 --- a/pkg/config/interface.go +++ b/pkg/config/interface.go @@ -18,8 +18,8 @@ package config import ( - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) // ProjectConfig represents the project's experiments and feature flags and contains methods for accessing the them. diff --git a/pkg/config/optimizely_config.go b/pkg/config/optimizely_config.go index 691b26fb1..289e90e69 100644 --- a/pkg/config/optimizely_config.go +++ b/pkg/config/optimizely_config.go @@ -22,8 +22,8 @@ import ( "fmt" "strings" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig/mappers" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig/mappers" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // OptimizelyConfig is a snapshot of the experiments and features in the project config diff --git a/pkg/config/polling_manager.go b/pkg/config/polling_manager.go index 1b2068b5a..654bba4e9 100644 --- a/pkg/config/polling_manager.go +++ b/pkg/config/polling_manager.go @@ -24,11 +24,11 @@ import ( "sync" "time" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/registry" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/registry" + "github.com/optimizely/go-sdk/v2/pkg/utils" "github.com/pkg/errors" ) diff --git a/pkg/config/polling_manager_test.go b/pkg/config/polling_manager_test.go index 8e2b4a900..96673ed88 100644 --- a/pkg/config/polling_manager_test.go +++ b/pkg/config/polling_manager_test.go @@ -23,10 +23,10 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/config/static_manager.go b/pkg/config/static_manager.go index 582e0968e..3540b44b7 100644 --- a/pkg/config/static_manager.go +++ b/pkg/config/static_manager.go @@ -22,10 +22,10 @@ import ( "fmt" "sync" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) // StaticProjectConfigManager maintains a static copy of the project config diff --git a/pkg/config/static_manager_test.go b/pkg/config/static_manager_test.go index 569ad0c84..b318f3867 100644 --- a/pkg/config/static_manager_test.go +++ b/pkg/config/static_manager_test.go @@ -20,9 +20,9 @@ import ( "errors" "testing" - "github.com/optimizely/go-sdk/pkg/config/datafileprojectconfig" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/config/datafileprojectconfig" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" "github.com/stretchr/testify/assert" ) diff --git a/pkg/decision/bucketer/experiment_bucketer.go b/pkg/decision/bucketer/experiment_bucketer.go index 13c17f426..14c31be8b 100644 --- a/pkg/decision/bucketer/experiment_bucketer.go +++ b/pkg/decision/bucketer/experiment_bucketer.go @@ -18,9 +18,9 @@ package bucketer import ( - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExperimentBucketer is used to bucket the user into a particular entity in the experiment's traffic alloc range diff --git a/pkg/decision/bucketer/experiment_bucketer_test.go b/pkg/decision/bucketer/experiment_bucketer_test.go index 8ec61b880..91c3f2a6a 100644 --- a/pkg/decision/bucketer/experiment_bucketer_test.go +++ b/pkg/decision/bucketer/experiment_bucketer_test.go @@ -1,12 +1,13 @@ package bucketer import ( - "github.com/optimizely/go-sdk/pkg/logging" "testing" - "github.com/optimizely/go-sdk/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/logging" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/decision/bucketer/murmurhashbucketer.go b/pkg/decision/bucketer/murmurhashbucketer.go index 879b00e14..c2667ff38 100644 --- a/pkg/decision/bucketer/murmurhashbucketer.go +++ b/pkg/decision/bucketer/murmurhashbucketer.go @@ -21,8 +21,8 @@ import ( "fmt" "math" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/twmb/murmur3" ) diff --git a/pkg/decision/bucketer/murmurhashbucketer_test.go b/pkg/decision/bucketer/murmurhashbucketer_test.go index 3db47c552..273aaa792 100644 --- a/pkg/decision/bucketer/murmurhashbucketer_test.go +++ b/pkg/decision/bucketer/murmurhashbucketer_test.go @@ -2,10 +2,11 @@ package bucketer import ( "fmt" - "github.com/optimizely/go-sdk/pkg/logging" "testing" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" + + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/assert" ) diff --git a/pkg/decision/composite_experiment_service.go b/pkg/decision/composite_experiment_service.go index 3f33a9f1b..d9069dfb1 100644 --- a/pkg/decision/composite_experiment_service.go +++ b/pkg/decision/composite_experiment_service.go @@ -18,9 +18,9 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // CESOptionFunc is used to assign optional configuration options diff --git a/pkg/decision/composite_experiment_service_test.go b/pkg/decision/composite_experiment_service_test.go index 38704c16f..3960be0a8 100644 --- a/pkg/decision/composite_experiment_service_test.go +++ b/pkg/decision/composite_experiment_service_test.go @@ -22,9 +22,9 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type CompositeExperimentTestSuite struct { diff --git a/pkg/decision/composite_feature_service.go b/pkg/decision/composite_feature_service.go index 1bd0925f2..24cba50ee 100644 --- a/pkg/decision/composite_feature_service.go +++ b/pkg/decision/composite_feature_service.go @@ -18,9 +18,9 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // CompositeFeatureService is the default out-of-the-box feature decision service diff --git a/pkg/decision/composite_feature_service_test.go b/pkg/decision/composite_feature_service_test.go index 513750983..acfbd9e5e 100644 --- a/pkg/decision/composite_feature_service_test.go +++ b/pkg/decision/composite_feature_service_test.go @@ -20,10 +20,10 @@ import ( "errors" "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/composite_service.go b/pkg/decision/composite_service.go index 78891820d..18e0614b9 100644 --- a/pkg/decision/composite_service.go +++ b/pkg/decision/composite_service.go @@ -20,11 +20,11 @@ package decision import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/registry" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/registry" ) // CompositeService is the entry-point into the decision service. It provides out of the box decision making for Features and Experiments. diff --git a/pkg/decision/composite_service_test.go b/pkg/decision/composite_service_test.go index 59196f2a7..a2960ae7b 100644 --- a/pkg/decision/composite_service_test.go +++ b/pkg/decision/composite_service_test.go @@ -21,9 +21,9 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) type CompositeServiceFeatureTestSuite struct { diff --git a/pkg/decision/entities.go b/pkg/decision/entities.go index 10884ac9f..63139329d 100644 --- a/pkg/decision/entities.go +++ b/pkg/decision/entities.go @@ -18,9 +18,9 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // ExperimentDecisionContext contains the information needed to be able to make a decision for a given experiment diff --git a/pkg/decision/evaluator/condition.go b/pkg/decision/evaluator/condition.go index 60301d1d3..10195afcd 100644 --- a/pkg/decision/evaluator/condition.go +++ b/pkg/decision/evaluator/condition.go @@ -21,10 +21,10 @@ import ( "errors" "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ItemEvaluator evaluates a condition against the given user's attributes diff --git a/pkg/decision/evaluator/condition_test.go b/pkg/decision/evaluator/condition_test.go index 90ea9ce42..1b011037c 100644 --- a/pkg/decision/evaluator/condition_test.go +++ b/pkg/decision/evaluator/condition_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/evaluator/condition_tree.go b/pkg/decision/evaluator/condition_tree.go index 3f546ceef..41ab3681b 100644 --- a/pkg/decision/evaluator/condition_tree.go +++ b/pkg/decision/evaluator/condition_tree.go @@ -20,9 +20,9 @@ package evaluator import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // String constant representing custom attribute condition type. diff --git a/pkg/decision/evaluator/condition_tree_test.go b/pkg/decision/evaluator/condition_tree_test.go index c349e590b..cddfbff6c 100644 --- a/pkg/decision/evaluator/condition_tree_test.go +++ b/pkg/decision/evaluator/condition_tree_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/decide" - e "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + e "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type MockLogger struct { diff --git a/pkg/decision/evaluator/matchers/exact.go b/pkg/decision/evaluator/matchers/exact.go index 42e498a65..295f684a0 100644 --- a/pkg/decision/evaluator/matchers/exact.go +++ b/pkg/decision/evaluator/matchers/exact.go @@ -20,9 +20,9 @@ package matchers import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers/utils" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers/utils" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExactMatcher matches against the "exact" match type diff --git a/pkg/decision/evaluator/matchers/exact_test.go b/pkg/decision/evaluator/matchers/exact_test.go index 68c78b92d..8f99b42fa 100644 --- a/pkg/decision/evaluator/matchers/exact_test.go +++ b/pkg/decision/evaluator/matchers/exact_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type MockLogger struct { diff --git a/pkg/decision/evaluator/matchers/exists.go b/pkg/decision/evaluator/matchers/exists.go index f3e7f4d68..b7ac52fc2 100644 --- a/pkg/decision/evaluator/matchers/exists.go +++ b/pkg/decision/evaluator/matchers/exists.go @@ -18,8 +18,8 @@ package matchers import ( - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExistsMatcher matches against the "exists" match type diff --git a/pkg/decision/evaluator/matchers/exists_test.go b/pkg/decision/evaluator/matchers/exists_test.go index 8bb728ee4..602012049 100644 --- a/pkg/decision/evaluator/matchers/exists_test.go +++ b/pkg/decision/evaluator/matchers/exists_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) var existsMatcher, _ = Get(ExistsMatchType) diff --git a/pkg/decision/evaluator/matchers/ge.go b/pkg/decision/evaluator/matchers/ge.go index ba232f0d6..6f059d758 100644 --- a/pkg/decision/evaluator/matchers/ge.go +++ b/pkg/decision/evaluator/matchers/ge.go @@ -20,10 +20,10 @@ package matchers import ( "fmt" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers/utils" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers/utils" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // GeMatcher matches against the "ge" match type diff --git a/pkg/decision/evaluator/matchers/ge_test.go b/pkg/decision/evaluator/matchers/ge_test.go index d0a2df15f..359eda4de 100644 --- a/pkg/decision/evaluator/matchers/ge_test.go +++ b/pkg/decision/evaluator/matchers/ge_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) var geMatcher, _ = Get(GeMatchType) diff --git a/pkg/decision/evaluator/matchers/gt.go b/pkg/decision/evaluator/matchers/gt.go index 3e27b1357..bdb0e3ce9 100644 --- a/pkg/decision/evaluator/matchers/gt.go +++ b/pkg/decision/evaluator/matchers/gt.go @@ -20,9 +20,9 @@ package matchers import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers/utils" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers/utils" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // GtMatcher matches against the "gt" match type diff --git a/pkg/decision/evaluator/matchers/gt_test.go b/pkg/decision/evaluator/matchers/gt_test.go index adaa1f148..4ae92baca 100644 --- a/pkg/decision/evaluator/matchers/gt_test.go +++ b/pkg/decision/evaluator/matchers/gt_test.go @@ -22,8 +22,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type GtTestSuite struct { diff --git a/pkg/decision/evaluator/matchers/le.go b/pkg/decision/evaluator/matchers/le.go index 96d2c8c85..231df4d9d 100644 --- a/pkg/decision/evaluator/matchers/le.go +++ b/pkg/decision/evaluator/matchers/le.go @@ -20,10 +20,10 @@ package matchers import ( "fmt" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" - "github.com/optimizely/go-sdk/pkg/decision/evaluator/matchers/utils" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator/matchers/utils" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // LeMatcher matches against the "le" match type diff --git a/pkg/decision/evaluator/matchers/le_test.go b/pkg/decision/evaluator/matchers/le_test.go index 10f9d1167..fb4a4b41c 100644 --- a/pkg/decision/evaluator/matchers/le_test.go +++ b/pkg/decision/evaluator/matchers/le_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) var leMatcher, _ = Get(LeMatchType) diff --git a/pkg/decision/evaluator/matchers/lt.go b/pkg/decision/evaluator/matchers/lt.go index a01cc563d..a7631fc3a 100644 --- a/pkg/decision/evaluator/matchers/lt.go +++ b/pkg/decision/evaluator/matchers/lt.go @@ -18,8 +18,8 @@ package matchers import ( - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // LtMatcher matches against the "lt" match type diff --git a/pkg/decision/evaluator/matchers/lt_test.go b/pkg/decision/evaluator/matchers/lt_test.go index ae6cb2b20..34adba58d 100644 --- a/pkg/decision/evaluator/matchers/lt_test.go +++ b/pkg/decision/evaluator/matchers/lt_test.go @@ -22,8 +22,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type LtTestSuite struct { diff --git a/pkg/decision/evaluator/matchers/qualified.go b/pkg/decision/evaluator/matchers/qualified.go index 5f9f1dbe7..9d964c1ae 100644 --- a/pkg/decision/evaluator/matchers/qualified.go +++ b/pkg/decision/evaluator/matchers/qualified.go @@ -20,8 +20,8 @@ package matchers import ( "fmt" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // QualifiedMatcher matches against the "qualified" match type diff --git a/pkg/decision/evaluator/matchers/qualified_test.go b/pkg/decision/evaluator/matchers/qualified_test.go index af72bc5b0..495402c47 100644 --- a/pkg/decision/evaluator/matchers/qualified_test.go +++ b/pkg/decision/evaluator/matchers/qualified_test.go @@ -22,8 +22,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type QualifiedTestSuite struct { diff --git a/pkg/decision/evaluator/matchers/registry.go b/pkg/decision/evaluator/matchers/registry.go index 5c71170f4..9ac5c19ef 100644 --- a/pkg/decision/evaluator/matchers/registry.go +++ b/pkg/decision/evaluator/matchers/registry.go @@ -20,8 +20,8 @@ package matchers import ( "sync" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // Matcher type is used to evaluate audience conditional primitives diff --git a/pkg/decision/evaluator/matchers/registry_test.go b/pkg/decision/evaluator/matchers/registry_test.go index 20d065169..fb30ed3c5 100644 --- a/pkg/decision/evaluator/matchers/registry_test.go +++ b/pkg/decision/evaluator/matchers/registry_test.go @@ -22,8 +22,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) func TestRegister(t *testing.T) { diff --git a/pkg/decision/evaluator/matchers/semver.go b/pkg/decision/evaluator/matchers/semver.go index e0ae62d5c..b9deaaf2c 100644 --- a/pkg/decision/evaluator/matchers/semver.go +++ b/pkg/decision/evaluator/matchers/semver.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/pkg/errors" ) diff --git a/pkg/decision/evaluator/matchers/semver_test.go b/pkg/decision/evaluator/matchers/semver_test.go index 6fc79e813..e3bafa0c6 100644 --- a/pkg/decision/evaluator/matchers/semver_test.go +++ b/pkg/decision/evaluator/matchers/semver_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) func TestValidAttributes(t *testing.T) { diff --git a/pkg/decision/evaluator/matchers/substring.go b/pkg/decision/evaluator/matchers/substring.go index ed1de1ad9..2ffdbacc3 100644 --- a/pkg/decision/evaluator/matchers/substring.go +++ b/pkg/decision/evaluator/matchers/substring.go @@ -21,8 +21,8 @@ import ( "fmt" "strings" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // SubstringMatcher matches against the "substring" match type diff --git a/pkg/decision/evaluator/matchers/substring_test.go b/pkg/decision/evaluator/matchers/substring_test.go index 42446631c..a117a1a7c 100644 --- a/pkg/decision/evaluator/matchers/substring_test.go +++ b/pkg/decision/evaluator/matchers/substring_test.go @@ -22,8 +22,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) type SubstringTestSuite struct { diff --git a/pkg/decision/experiment_bucketer_service.go b/pkg/decision/experiment_bucketer_service.go index c45fd9bf7..0dd578262 100644 --- a/pkg/decision/experiment_bucketer_service.go +++ b/pkg/decision/experiment_bucketer_service.go @@ -20,12 +20,12 @@ package decision import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/bucketer" - "github.com/optimizely/go-sdk/pkg/decision/evaluator" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/bucketer" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExperimentBucketerService makes a decision using the experiment bucketer diff --git a/pkg/decision/experiment_bucketer_service_test.go b/pkg/decision/experiment_bucketer_service_test.go index 374fe2730..1c1be81a5 100644 --- a/pkg/decision/experiment_bucketer_service_test.go +++ b/pkg/decision/experiment_bucketer_service_test.go @@ -20,11 +20,11 @@ import ( "fmt" "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/logging" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/experiment_override_service.go b/pkg/decision/experiment_override_service.go index 3266f3a06..290af09ba 100644 --- a/pkg/decision/experiment_override_service.go +++ b/pkg/decision/experiment_override_service.go @@ -22,10 +22,10 @@ import ( "fmt" "sync" - "github.com/optimizely/go-sdk/pkg/decide" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExperimentOverrideKey represents the user ID and experiment associated with an override variation diff --git a/pkg/decision/experiment_override_service_test.go b/pkg/decision/experiment_override_service_test.go index d1fa7cf57..cfa38d3aa 100644 --- a/pkg/decision/experiment_override_service_test.go +++ b/pkg/decision/experiment_override_service_test.go @@ -21,10 +21,10 @@ import ( "sync" "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/experiment_whitelist_service.go b/pkg/decision/experiment_whitelist_service.go index b05dba1a8..ad2d614e6 100644 --- a/pkg/decision/experiment_whitelist_service.go +++ b/pkg/decision/experiment_whitelist_service.go @@ -20,9 +20,9 @@ package decision import ( "errors" - "github.com/optimizely/go-sdk/pkg/decide" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decide" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // ExperimentWhitelistService makes a decision using an experiment's whitelist (a map of user id to variation keys) diff --git a/pkg/decision/experiment_whitelist_service_test.go b/pkg/decision/experiment_whitelist_service_test.go index 508084df1..598a4fd3b 100644 --- a/pkg/decision/experiment_whitelist_service_test.go +++ b/pkg/decision/experiment_whitelist_service_test.go @@ -20,9 +20,9 @@ package decision import ( "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/feature_experiment_service.go b/pkg/decision/feature_experiment_service.go index e8c8e0ab8..e9f07ec62 100644 --- a/pkg/decision/feature_experiment_service.go +++ b/pkg/decision/feature_experiment_service.go @@ -20,9 +20,9 @@ package decision import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // FeatureExperimentService helps evaluate feature test associated with the feature diff --git a/pkg/decision/feature_experiment_service_test.go b/pkg/decision/feature_experiment_service_test.go index f08961bfe..d7160d568 100644 --- a/pkg/decision/feature_experiment_service_test.go +++ b/pkg/decision/feature_experiment_service_test.go @@ -19,9 +19,9 @@ package decision import ( "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/feature_notification.go b/pkg/decision/feature_notification.go index 39fbf4f5d..fdb856c45 100644 --- a/pkg/decision/feature_notification.go +++ b/pkg/decision/feature_notification.go @@ -18,8 +18,8 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) // FeatureNotificationWithVariables constructs feature notification with variables diff --git a/pkg/decision/feature_notification_test.go b/pkg/decision/feature_notification_test.go index c75d22081..577fe7aa6 100644 --- a/pkg/decision/feature_notification_test.go +++ b/pkg/decision/feature_notification_test.go @@ -20,8 +20,8 @@ package decision import ( "testing" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" "github.com/stretchr/testify/assert" ) diff --git a/pkg/decision/flag_notification.go b/pkg/decision/flag_notification.go index a4c718fe5..6d6030a49 100644 --- a/pkg/decision/flag_notification.go +++ b/pkg/decision/flag_notification.go @@ -18,8 +18,8 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) // FlagNotification constructs default flag notification diff --git a/pkg/decision/forced_decision_service.go b/pkg/decision/forced_decision_service.go index 50fc9379c..0f5fd1f1d 100644 --- a/pkg/decision/forced_decision_service.go +++ b/pkg/decision/forced_decision_service.go @@ -21,9 +21,9 @@ import ( "errors" "sync" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // OptimizelyDecisionContext defines Decision Context diff --git a/pkg/decision/forced_decision_service_test.go b/pkg/decision/forced_decision_service_test.go index b6b9ae312..ddb813709 100644 --- a/pkg/decision/forced_decision_service_test.go +++ b/pkg/decision/forced_decision_service_test.go @@ -24,8 +24,8 @@ import ( "sync" "testing" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" "github.com/stretchr/testify/suite" ) diff --git a/pkg/decision/helpers_test.go b/pkg/decision/helpers_test.go index 70cc44419..56a7e1687 100644 --- a/pkg/decision/helpers_test.go +++ b/pkg/decision/helpers_test.go @@ -22,9 +22,9 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/mock" ) diff --git a/pkg/decision/interface.go b/pkg/decision/interface.go index ec5a4cadc..ae45db515 100644 --- a/pkg/decision/interface.go +++ b/pkg/decision/interface.go @@ -18,9 +18,9 @@ package decision import ( - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) // Service interface is used to make a decision for a given feature or experiment diff --git a/pkg/decision/persisting_experiment_service.go b/pkg/decision/persisting_experiment_service.go index 6055c8f3b..b27f8414b 100644 --- a/pkg/decision/persisting_experiment_service.go +++ b/pkg/decision/persisting_experiment_service.go @@ -20,9 +20,9 @@ package decision import ( "fmt" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // PersistingExperimentService attempts to retrieve a saved decision from the user profile service diff --git a/pkg/decision/persisting_experiment_service_test.go b/pkg/decision/persisting_experiment_service_test.go index f9fa47c1f..d3fc21f92 100644 --- a/pkg/decision/persisting_experiment_service_test.go +++ b/pkg/decision/persisting_experiment_service_test.go @@ -20,9 +20,9 @@ package decision import ( "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" diff --git a/pkg/decision/rollout_service.go b/pkg/decision/rollout_service.go index e42a18693..13c1402c2 100644 --- a/pkg/decision/rollout_service.go +++ b/pkg/decision/rollout_service.go @@ -21,11 +21,11 @@ import ( "fmt" "strconv" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/evaluator" - pkgReasons "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator" + pkgReasons "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // RolloutService makes a feature decision for a given feature rollout diff --git a/pkg/decision/rollout_service_test.go b/pkg/decision/rollout_service_test.go index 9bf160dbc..70cd20b03 100644 --- a/pkg/decision/rollout_service_test.go +++ b/pkg/decision/rollout_service_test.go @@ -20,11 +20,11 @@ import ( "fmt" "testing" - "github.com/optimizely/go-sdk/pkg/decide" - "github.com/optimizely/go-sdk/pkg/decision/evaluator" - "github.com/optimizely/go-sdk/pkg/decision/reasons" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/decide" + "github.com/optimizely/go-sdk/v2/pkg/decision/evaluator" + "github.com/optimizely/go-sdk/v2/pkg/decision/reasons" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/entities/user_context.go b/pkg/entities/user_context.go index 99e54544a..881f4fd91 100644 --- a/pkg/entities/user_context.go +++ b/pkg/entities/user_context.go @@ -20,7 +20,7 @@ package entities import ( "fmt" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) const bucketingIDAttributeName = "$opt_bucketing_id" diff --git a/pkg/event/dispatcher.go b/pkg/event/dispatcher.go index 987990359..8d01c79ed 100644 --- a/pkg/event/dispatcher.go +++ b/pkg/event/dispatcher.go @@ -25,9 +25,9 @@ import ( "golang.org/x/sync/semaphore" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/metrics" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/metrics" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) const maxWorkers = int64(1) diff --git a/pkg/event/dispatcher_test.go b/pkg/event/dispatcher_test.go index a3c4e07c9..f3af38952 100644 --- a/pkg/event/dispatcher_test.go +++ b/pkg/event/dispatcher_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/metrics" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/metrics" "github.com/stretchr/testify/assert" ) diff --git a/pkg/event/factory.go b/pkg/event/factory.go index a0de25f9a..c15369711 100644 --- a/pkg/event/factory.go +++ b/pkg/event/factory.go @@ -24,10 +24,10 @@ import ( guuid "github.com/google/uuid" - "github.com/optimizely/go-sdk/pkg/config" - decisionPkg "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/config" + decisionPkg "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) const impressionKey string = "campaign_activated" diff --git a/pkg/event/factory_test.go b/pkg/event/factory_test.go index 04df215bd..ea4ed82dd 100644 --- a/pkg/event/factory_test.go +++ b/pkg/event/factory_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/config" - "github.com/optimizely/go-sdk/pkg/decision" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/config" + "github.com/optimizely/go-sdk/v2/pkg/decision" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) var testExperiment = entities.Experiment{ diff --git a/pkg/event/processor.go b/pkg/event/processor.go index f1727d9c7..4cefda214 100644 --- a/pkg/event/processor.go +++ b/pkg/event/processor.go @@ -26,10 +26,10 @@ import ( "golang.org/x/sync/semaphore" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/metrics" - "github.com/optimizely/go-sdk/pkg/notification" - "github.com/optimizely/go-sdk/pkg/registry" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/metrics" + "github.com/optimizely/go-sdk/v2/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/registry" ) // Processor processes events diff --git a/pkg/event/processor_test.go b/pkg/event/processor_test.go index 15b346d28..5f5fd1580 100644 --- a/pkg/event/processor_test.go +++ b/pkg/event/processor_test.go @@ -27,8 +27,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/utils" ) type CountingDispatcher struct { diff --git a/pkg/event/queue.go b/pkg/event/queue.go index d8470f60a..33715808d 100644 --- a/pkg/event/queue.go +++ b/pkg/event/queue.go @@ -20,7 +20,7 @@ package event import ( "sync" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // Queue represents a queue diff --git a/pkg/notification/center.go b/pkg/notification/center.go index dd6abbfd6..08772fe47 100644 --- a/pkg/notification/center.go +++ b/pkg/notification/center.go @@ -19,7 +19,8 @@ package notification import ( "fmt" - "github.com/optimizely/go-sdk/pkg/logging" + + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // Center handles all notification listeners. It keeps track of the Manager for each type of notification. diff --git a/pkg/notification/center_test.go b/pkg/notification/center_test.go index 169f7367f..40e85a3e6 100644 --- a/pkg/notification/center_test.go +++ b/pkg/notification/center_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" "github.com/stretchr/testify/mock" ) diff --git a/pkg/notification/entities.go b/pkg/notification/entities.go index edb801c9c..46fc7f207 100644 --- a/pkg/notification/entities.go +++ b/pkg/notification/entities.go @@ -18,7 +18,7 @@ package notification import ( - "github.com/optimizely/go-sdk/pkg/entities" + "github.com/optimizely/go-sdk/v2/pkg/entities" ) // Type is the type of notification diff --git a/pkg/notification/manager.go b/pkg/notification/manager.go index 919d59930..8ae6b148b 100644 --- a/pkg/notification/manager.go +++ b/pkg/notification/manager.go @@ -22,7 +22,7 @@ import ( "sync" "sync/atomic" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // Manager is a generic interface for managing notifications of a particular type diff --git a/pkg/notification/manager_test.go b/pkg/notification/manager_test.go index 7c3a0f773..ebcd9ad4f 100644 --- a/pkg/notification/manager_test.go +++ b/pkg/notification/manager_test.go @@ -3,7 +3,7 @@ package notification import ( "testing" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/odp/config/config.go b/pkg/odp/config/config.go index ee865f648..d26d844b2 100644 --- a/pkg/odp/config/config.go +++ b/pkg/odp/config/config.go @@ -20,7 +20,7 @@ package config import ( "sync" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" ) // Config is used to represent odp config diff --git a/pkg/odp/event/event_api_manager.go b/pkg/odp/event/event_api_manager.go index e05a55ae6..128ec562d 100644 --- a/pkg/odp/event/event_api_manager.go +++ b/pkg/odp/event/event_api_manager.go @@ -21,9 +21,9 @@ import ( "fmt" "net/url" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/utils" - pkgUtils "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/utils" ) // APIManager represents the event API manager. diff --git a/pkg/odp/event/event_api_manager_test.go b/pkg/odp/event/event_api_manager_test.go index 29e580bf4..355e9a376 100644 --- a/pkg/odp/event/event_api_manager_test.go +++ b/pkg/odp/event/event_api_manager_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/odp/utils" - pkgUtils "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/utils" "github.com/stretchr/testify/suite" ) diff --git a/pkg/odp/event/event_manager.go b/pkg/odp/event/event_manager.go index 11a2ef8ae..18dbad1fd 100644 --- a/pkg/odp/event/event_manager.go +++ b/pkg/odp/event/event_manager.go @@ -26,10 +26,10 @@ import ( "time" guuid "github.com/google/uuid" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/config" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/config" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" "golang.org/x/sync/semaphore" ) diff --git a/pkg/odp/event/event_manager_test.go b/pkg/odp/event/event_manager_test.go index 194f89478..47b892d0a 100644 --- a/pkg/odp/event/event_manager_test.go +++ b/pkg/odp/event/event_manager_test.go @@ -25,11 +25,11 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/event" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/config" - "github.com/optimizely/go-sdk/pkg/odp/utils" - pkgUtils "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/event" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/config" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/utils" "github.com/stretchr/testify/suite" ) diff --git a/pkg/odp/odp_manager.go b/pkg/odp/odp_manager.go index b7e014276..88c063912 100644 --- a/pkg/odp/odp_manager.go +++ b/pkg/odp/odp_manager.go @@ -21,12 +21,12 @@ import ( "errors" "time" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/cache" - "github.com/optimizely/go-sdk/pkg/odp/config" - "github.com/optimizely/go-sdk/pkg/odp/event" - "github.com/optimizely/go-sdk/pkg/odp/segment" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/cache" + "github.com/optimizely/go-sdk/v2/pkg/odp/config" + "github.com/optimizely/go-sdk/v2/pkg/odp/event" + "github.com/optimizely/go-sdk/v2/pkg/odp/segment" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" ) // OMOptionFunc are the ODPManager options that give you the ability to add one more more options before the odp manager is initialized. diff --git a/pkg/odp/odp_manager_test.go b/pkg/odp/odp_manager_test.go index a7d4475b1..8c78ec539 100644 --- a/pkg/odp/odp_manager_test.go +++ b/pkg/odp/odp_manager_test.go @@ -23,11 +23,11 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/odp/cache" - "github.com/optimizely/go-sdk/pkg/odp/config" - "github.com/optimizely/go-sdk/pkg/odp/event" - "github.com/optimizely/go-sdk/pkg/odp/segment" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/odp/cache" + "github.com/optimizely/go-sdk/v2/pkg/odp/config" + "github.com/optimizely/go-sdk/v2/pkg/odp/event" + "github.com/optimizely/go-sdk/v2/pkg/odp/segment" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) diff --git a/pkg/odp/segment/segment_api_manager.go b/pkg/odp/segment/segment_api_manager.go index 573d874bb..ea92ab8e0 100644 --- a/pkg/odp/segment/segment_api_manager.go +++ b/pkg/odp/segment/segment_api_manager.go @@ -24,9 +24,9 @@ import ( "net/url" "strings" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/utils" - pkgUtils "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/utils" ) const graphqlAPIEndpointPath = "/v3/graphql" diff --git a/pkg/odp/segment/segment_api_manager_test.go b/pkg/odp/segment/segment_api_manager_test.go index 3d2458eca..00b847a15 100644 --- a/pkg/odp/segment/segment_api_manager_test.go +++ b/pkg/odp/segment/segment_api_manager_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/logging" - "github.com/optimizely/go-sdk/pkg/odp/utils" - pkgUtils "github.com/optimizely/go-sdk/pkg/utils" + "github.com/optimizely/go-sdk/v2/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" + pkgUtils "github.com/optimizely/go-sdk/v2/pkg/utils" "github.com/stretchr/testify/suite" ) diff --git a/pkg/odp/segment/segment_manager.go b/pkg/odp/segment/segment_manager.go index 685345947..1b866a45c 100644 --- a/pkg/odp/segment/segment_manager.go +++ b/pkg/odp/segment/segment_manager.go @@ -21,8 +21,8 @@ import ( "fmt" "time" - "github.com/optimizely/go-sdk/pkg/odp/cache" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/odp/cache" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" ) // SMOptionFunc are the SegmentManager options that give you the ability to add one more more options before the segment manager is initialized. diff --git a/pkg/odp/segment/segment_manager_test.go b/pkg/odp/segment/segment_manager_test.go index 13ee58a38..1dbe79477 100644 --- a/pkg/odp/segment/segment_manager_test.go +++ b/pkg/odp/segment/segment_manager_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/odp/utils" + "github.com/optimizely/go-sdk/v2/pkg/odp/utils" "github.com/stretchr/testify/suite" ) diff --git a/pkg/odp/utils/utils.go b/pkg/odp/utils/utils.go index 7f956a122..2f7da2025 100644 --- a/pkg/odp/utils/utils.go +++ b/pkg/odp/utils/utils.go @@ -17,7 +17,7 @@ // Package utils // package utils -import "github.com/optimizely/go-sdk/pkg/utils" +import "github.com/optimizely/go-sdk/v2/pkg/utils" // CompareSlices determines if two string slices are equal func CompareSlices(a, b []string) bool { diff --git a/pkg/registry/service.go b/pkg/registry/service.go index 88f64db1d..e68102101 100644 --- a/pkg/registry/service.go +++ b/pkg/registry/service.go @@ -20,7 +20,7 @@ package registry import ( "sync" - "github.com/optimizely/go-sdk/pkg/notification" + "github.com/optimizely/go-sdk/v2/pkg/notification" ) var notificationCenterCache = make(map[string]notification.Center) diff --git a/pkg/utils/execgroup.go b/pkg/utils/execgroup.go index 509608c7c..df72a7cd5 100644 --- a/pkg/utils/execgroup.go +++ b/pkg/utils/execgroup.go @@ -19,8 +19,9 @@ package utils import ( "context" - "github.com/optimizely/go-sdk/pkg/logging" "sync" + + "github.com/optimizely/go-sdk/v2/pkg/logging" ) // ExecGroup is a utility for managing graceful, blocking cancellation of goroutines. diff --git a/pkg/utils/execgroup_test.go b/pkg/utils/execgroup_test.go index 6357a442a..e79f06138 100644 --- a/pkg/utils/execgroup_test.go +++ b/pkg/utils/execgroup_test.go @@ -19,9 +19,10 @@ package utils import ( "context" - "github.com/optimizely/go-sdk/pkg/logging" "sync" "testing" + + "github.com/optimizely/go-sdk/v2/pkg/logging" ) func TestWithContextCancelFunc(t *testing.T) { diff --git a/pkg/utils/requester.go b/pkg/utils/requester.go index b734f562f..a8f8f4de5 100644 --- a/pkg/utils/requester.go +++ b/pkg/utils/requester.go @@ -25,7 +25,7 @@ import ( "net/http" "time" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" jsoniter "github.com/json-iterator/go" ) diff --git a/pkg/utils/requester_test.go b/pkg/utils/requester_test.go index 71e7a70a1..10e6fb654 100644 --- a/pkg/utils/requester_test.go +++ b/pkg/utils/requester_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/optimizely/go-sdk/pkg/logging" + "github.com/optimizely/go-sdk/v2/pkg/logging" "github.com/stretchr/testify/assert" ) From 047037efb38a642870eaab866b2d168f0cba3a0a Mon Sep 17 00:00:00 2001 From: pulak-opti <129880418+pulak-opti@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:37:13 +0600 Subject: [PATCH 4/4] Update LICENSE Co-authored-by: Mike Chu <104384559+mikechu-optimizely@users.noreply.github.com> --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c9f7279d1..f2f83230c 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024, Optimizely, Inc. and contributors + Copyright 2016 Optimizely, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.