You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is code in /utils/timeoutcon.go and /utils/timeoutconn_test.go to handle timeouts of network connections. This package is too big and it would help to move this type and it's tests to a new package.
Proposed solution:
Move the type and tests into a new package inside the /pkg directory called timeout and refactor the API. A proposed change for the function could look like:
Being inside a separate package this type does not need to be exported. You can do this by changing the case from TimeoutConn to timeoutConn. Also because moving this into a separate package already namespaces the types, it would be redundent to keep the word timeout or conn in the type and constructor names. It's much simpler to have just conn and New as the responsibility is clear based on the package that they are in.
The text was updated successfully, but these errors were encountered:
Summary:
Currently there is code in
/utils/timeoutcon.go
and/utils/timeoutconn_test.go
to handle timeouts of network connections. This package is too big and it would help to move this type and it's tests to a new package.Proposed solution:
Move the type and tests into a new package inside the
/pkg
directory calledtimeout
and refactor the API. A proposed change for the function could look like:Being inside a separate package this type does not need to be exported. You can do this by changing the case from
TimeoutConn
totimeoutConn
. Also because moving this into a separate package already namespaces the types, it would be redundent to keep the word timeout or conn in the type and constructor names. It's much simpler to have justconn
andNew
as the responsibility is clear based on the package that they are in.The text was updated successfully, but these errors were encountered: