status-go icon indicating copy to clipboard operation
status-go copied to clipboard

messenger_testing_utils.go pollutes production scope

Open osmaczko opened this issue 1 year ago • 3 comments

Files without _test.go suffix are compiled and included into the package when building the production binary.

See https://github.com/status-im/status-go/issues/4594#issuecomment-1900283194_

osmaczko avatar Jan 19 '24 11:01 osmaczko

FYI: @igor-sirotin

osmaczko avatar Jan 19 '24 12:01 osmaczko

Files without _test.go suffix are compiled and included into the package when building the production binary.

Yes, but as far as I remember I couldn't use these functions when they were in _test.go file.

igor-sirotin avatar Jan 19 '24 12:01 igor-sirotin

Yes, but as far as I remember I couldn't use these functions when they were in _test.go file.

Correct, you cannot use test utilities defined in one package within the *_test.go files of another package. However, messenger_testing_utils.go might not be the best approach as stated in the issue.

osmaczko avatar Jan 19 '24 12:01 osmaczko