One, straight forward, but potentially noisy way to fix this is to use the type system to prevent the propagation of invalid data. Replacing the existing `string` type with a `net.IP` type throughout the program would ensure that all code paths are in an IP format and force the code to explicitly resolve any hostnames on input.
One, straight forward, but potentially noisy way to fix this is to use the type system to prevent the propagation of invalid data. Replacing the existing `string` type with a `net.IP` type throughout the program would ensure that all code paths are in an IP format and force the code to explicitly resolve any hostnames on input.