Looks pretty shoddy from an IPv4/IPv6 point of view. It uses fmt.Sprintf("%s:%s") instead of net.JoinHostPort, and net.ResolveTCPAddr returns a single IP address instead of a properly-ordered list.
So it will probably fail to connect to an IPv6 literal, or to a dualstack hostname from an IPv6-only client.
So it will probably fail to connect to an IPv6 literal, or to a dualstack hostname from an IPv6-only client.