Move all files from pkg/openfeature to the root. #233
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
Move the package from being
github.com/open-feature/go-sdk/pkg/openfeature, which has an unnecessary pkg in the import path, to github.com/open-feature/go-sdk, without the unnecessary "pkg" in the import path.
The existing github.com/open-feature/go-sdk/pkg/openfeature package is now a compatibility shell; exported types, constants, variables, and functions are now aliased to the new github.com/open-feature/go-sdk equivalents in a way that will pass equality checks, and types are interchangeable between both packages. No logic or tests live in the package anymore, only the exported identifiers, which call through to the new package for behavior.
The memprovider package, similarly, has moved.
The shortcoming of this import path is that goimports will struggle in some situations to be able to automatically add the import path based on the package name when it's used for the first time in a consumer package.
Related Issues
Fixes #227
How to test
Any consumers of the package that already exist should be able to transparently use this version (
go mod edit -replace github.com/open-feature/go-sdk=github.com/paddycarver/open-feature@root
) with no code changes or changes in behavior.