This adds tests to verify that we can handle multiple metrics separated by newline characters in TCP and Unix socket connections. It also adds a NilConn struct which is a net.Conn interface implementation. The purpose of this is because when the connection pool times out, it currently returns nil. This is poor because it tries to coerce nil into a net.Conn which causes a nil pointer access error. The new NilConn allows us to return the proper type and panic if client code tries to use it. This is much more graceful and allows us to properly test access to a broken connection.
This adds tests to verify that we can handle multiple metrics separated by newline characters in TCP and Unix socket connections. It also adds a NilConn struct which is a net.Conn interface implementation. The purpose of this is because when the connection pool times out, it currently returns nil. This is poor because it tries to coerce nil into a net.Conn which causes a nil pointer access error. The new NilConn allows us to return the proper type and panic if client code tries to use it. This is much more graceful and allows us to properly test access to a broken connection.