When the statsd client is created with a non-empty address but without ports. For example localhost instead of localhost:8125 it should rely on DD_DOGSTATSD_PORT to set the port properly. However the code has a bug where populating the variable containing the result of this envar is never used.
When the statsd client is created with a non-empty address but without ports. For example
localhost
instead oflocalhost:8125
it should rely on DD_DOGSTATSD_PORT to set the port properly. However the code has a bug where populating the variable containing the result of this envar is never used.In the code here: https://github.com/DataDog/datadog-go/blob/master/statsd/statsd.go#L310-L344
envPort is only set within this if statement, later on it is used like so:
which means that the else statement will be called always if the addr was not empty