Open gm42 opened 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.
testing
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
v3.0.1
Language version, developer tools go version go1.20.4 linux/amd6
go version go1.20.4 linux/amd6
OS/platform Linux
Additional context You can find similar bug reports in other open source SDKs
Hi @gm42, thanks for the report. I agree this isn't optimal.
Filed internally as 216653.
Any news on this? It's the only dependency we have which links testing
Sorry - no updates. It is on our backlog.
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 thetesting
package global init() first.To reproduce
Output:
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