Making codebase improvements by making an address struct to host the Ip as net.IP and port. This enables us to access the functions available on net.IP vars directly compared to storing it as a string.
Changes to HandleConnect function: Using a switch instead of if/else statements
The improvements required a bit more changes to cover when the address is a path e.g A Unix Socket Path. The GetIPAndPortdata returns a string in case a path is an address.
The path addresses can be ignored and the syscall blocked for cleaner code.
Making codebase improvements by making an address struct to host the Ip as net.IP and port. This enables us to access the functions available on net.IP vars directly compared to storing it as a string. Changes to HandleConnect function: Using a switch instead of if/else statements The improvements required a bit more changes to cover when the address is a path e.g A Unix Socket Path. The GetIPAndPortdata returns a string in case a path is an address. The path addresses can be ignored and the syscall blocked for cleaner code.