Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

testing package is used in non-tests code #97

Open
gm42 opened this issue Sep 11, 2023 · 3 comments
Open

testing package is used in non-tests code #97

gm42 opened this issue Sep 11, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@gm42
Copy link

gm42 commented Sep 11, 2023

Is this a support request?
No

Describe the bug
The LaunchDarkly Go SDK depends on testing package; this increases the size of release binaries and will create issues when accessing the command-line flags because they will be parsed by the testing package global init() first.

To reproduce

for PKG in github.com/launchdarkly/ccache github.com/launchdarkly/eventsource github.com/launchdarkly/go-jsonstream/v3/jreader github.com/launchdarkly/go-jsonstream/v3/jwriter github.com/launchdarkly/go-sdk-common/v3/ldattr github.com/launchdarkly/go-sdk-common/v3/ldcontext github.com/launchdarkly/go-sdk-common/v3/lderrors github.com/launchdarkly/go-sdk-common/v3/ldlog github.com/launchdarkly/go-sdk-common/v3/ldreason github.com/launchdarkly/go-sdk-common/v3/ldtime github.com/launchdarkly/go-sdk-common/v3/ldvalue github.com/launchdarkly/go-sdk-events/v2 github.com/launchdarkly/go-semver github.com/launchdarkly/go-server-sdk-evaluation/v2 github.com/launchdarkly/go-server-sdk-evaluation/v2/internal github.com/launchdarkly/go-server-sdk-evaluation/v2/ldmodel github.com/launchdarkly/go-server-sdk/v6 github.com/launchdarkly/go-server-sdk/v6/interfaces github.com/launchdarkly/go-server-sdk/v6/interfaces/flagstate github.com/launchdarkly/go-server-sdk/v6/internal github.com/launchdarkly/go-server-sdk/v6/internal/bigsegments github.com/launchdarkly/go-server-sdk/v6/internal/datakinds github.com/launchdarkly/go-server-sdk/v6/internal/datasource github.com/launchdarkly/go-server-sdk/v6/internal/datastore github.com/launchdarkly/go-server-sdk/v6/internal/endpoints github.com/launchdarkly/go-server-sdk/v6/ldcomponents github.com/launchdarkly/go-server-sdk/v6/ldhttp github.com/launchdarkly/go-server-sdk/v6/subsystems github.com/launchdarkly/go-server-sdk/v6/subsystems/ldstoreimpl github.com/launchdarkly/go-server-sdk/v6/subsystems/ldstoretypes; do echo -n "$PKG: "; go list -deps $PKG | grep testing; echo; done | grep testing | awk -F: '{ print $1 }'

Output:

github.com/launchdarkly/go-semver
github.com/launchdarkly/go-server-sdk-evaluation/v2/ldmodel
github.com/launchdarkly/go-server-sdk-evaluation/v2
github.com/launchdarkly/go-server-sdk/v6/internal/datakinds
github.com/launchdarkly/go-server-sdk/v6/internal/datastore
github.com/launchdarkly/go-server-sdk/v6/subsystems/ldstoreimpl
github.com/launchdarkly/go-server-sdk/v6/internal/datasource
github.com/launchdarkly/go-server-sdk/v6/ldcomponents
github.com/launchdarkly/go-server-sdk/v6

Expected behavior
Only tests should depend on testing.

Logs
No logs

SDK version
v3.0.1

Language version, developer tools
go version go1.20.4 linux/amd6

OS/platform
Linux

Additional context
You can find similar bug reports in other open source SDKs

@cwaldren-ld cwaldren-ld added the enhancement New feature or request label Sep 11, 2023
@cwaldren-ld
Copy link
Contributor

Hi @gm42, thanks for the report. I agree this isn't optimal.

Filed internally as 216653.

@gm42
Copy link
Author

gm42 commented Nov 9, 2023

Any news on this? It's the only dependency we have which links testing

@cwaldren-ld
Copy link
Contributor

Sorry - no updates. It is on our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants