Looking for a way to iterate through specific ports to check connectivity between hosts. For example
conn, err := net.Dial("tcp", "golang.org:80")
if err != nil {
// handle error
I am looking to make the input all be read from some type of file such as YAML or JSON, so it can pass in whether it is UDP or TCP port and go through the different port number specified in the file, return results of connection and terminate once it finishes checking the final port listed. I am new to GO and any help or suggestions would be greatly appreciated.