[
https://issues.apache.org/jira/browse/THRIFT-5420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylwester Lachiewicz resolved THRIFT-5420.
------------------------------------------
Fix Version/s: 0.25.0
Resolution: Fixed
Fixed in master by [PR #3809|https://github.com/apache/thrift/pull/3809],
commit c4589712f.
{{TestLogger}} declared its parameter as {{testing.TB}}, which made {{testing}}
- and through it {{flag}} and {{runtime/trace}} - a build dependency of every
program linking lib/go/thrift. The parameter is now declared as the single
method the function calls, so a {{*testing.T}}, a {{*testing.B}} and a
{{testing.TB}} all still satisfy it and existing callers compile unchanged.
{{go list -deps ./lib/go/thrift}} no longer lists any of the three.
A test parses the package non-test files and fails if any of them imports
{{testing}}, so the dependency cannot come back unnoticed.
> Go library should not depend on "testing" in the main package
> -------------------------------------------------------------
>
> Key: THRIFT-5420
> URL: https://issues.apache.org/jira/browse/THRIFT-5420
> Project: Thrift
> Issue Type: Improvement
> Components: Go - Library
> Affects Versions: 0.14.0, 0.14.1
> Reporter: Yuri Shkuro
> Assignee: Sylwester Lachiewicz
> Priority: Minor
> Fix For: 0.25.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> From [https://github.com/jaegertracing/jaeger-client-go/issues/585:]
> *Describe the bug*
> Importing {{jaeger-client-go}} adds a dependency on the standard library
> "testing" package. This is undesirable because production Go programs should
> not depend on the testing package. In addition to unnecessary bloat,
> "testing" adds a bunch of command line flags.
> The dependency is coming from
> [https://github.com/apache/thrift/blob/66d897667c451ef6560d89b979b7001c57a3eda6/lib/go/thrift/logger.go#L58]
> *Recommendation*
> Move TestLogger to a sub-module like "testutils". Or remove completely since
> it's a trivial implementation that can be easily reproduced. Or replace
> testing.TB argument with a locally defined interface that exposes Errorf
> function.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)