Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Rename SetUpNetlinkTest to TestSetUpNetlink for consistency #2179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mahmut-Abi
Copy link

@mahmut-Abi mahmut-Abi commented Feb 5, 2025

In pkg/ns/ns.go, which is a test file, the function SetUpNetlinkTest is actually a test case. To adhere to Go's testing framework conventions and improve code readability, we rename it to TestSetUpNetlink.

The previous name did not follow the standard naming convention for test functions, which should start with 'Test' to be recognized by the testing framework.

Changes:

  • Renamed SetUpNetlinkTest to TestSetUpNetlink.
  • Updated the function signature to match Go's testing framework requirements (no return value).

Description

Todos

  • Tests
  • Documentation
  • Release note

Release Note

None required

In pkg/ns/ns.go, which is a test file, the function SetUpNetlinkTest is actually a test case. To adhere to Go's testing framework conventions and improve code readability, we rename it to TestSetUpNetlink.

The previous name did not follow the standard naming convention for test functions, which should start with 'Test' to be recognized by the testing framework.

Changes:
- Renamed SetUpNetlinkTest to TestSetUpNetlink.
- Updated the function signature to match Go's testing framework requirements (no return value).

Signed-off-by: mahmut <[email protected]>
@manuelbuil
Copy link
Collaborator

Are you sure about this? I understood that Go naming convention states that files with test functions should end with "_test.go". Example: https://go.dev/doc/tutorial/add-a-test

@mahmut-Abi
Copy link
Author

Thanks for pointing that out! According to Go's naming conventions, test files should indeed end with _test.go. I'll double-check and ensure all test files follow this convention. If there are any discrepancies, I'll fix them promptly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants