launchdarkly / go-server-sdk

LaunchDarkly Server-side SDK for Go
Other
41 stars 17 forks source link

testing package is used in non-tests code #97

Open gm42 opened 10 months ago

gm42 commented 10 months ago

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 commented 10 months ago

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

Filed internally as 216653.

gm42 commented 8 months ago

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

cwaldren-ld commented 7 months ago

Sorry - no updates. It is on our backlog.