Testing the Port Scanning Functionality

Creating the scanHosts_test.go file

We create a file scanHosts_test.go for the tests. We define the package package scan_test so it only tests the exposed API, as we did with the hosts tests:

Get hands-on with 1400+ tech skills courses.