Bugs and lint warning fixex

Fix domain map cuncurrent access
Fix ResolverInfo Domain was not copied bug
Fix linter warnings
This commit is contained in:
Vladimir Stoilov
2022-07-21 13:35:25 +02:00
parent efd33c223f
commit 8ca384a13d
6 changed files with 25 additions and 32 deletions

View File

@@ -30,9 +30,10 @@ const (
ServerSourceEnv = "env"
)
// DNS Resolver alias
const (
HttpsProtocol = "https"
TlsProtocol = "tls"
HTTPSProtocol = "https"
TLSProtocol = "tls"
)
// FailThreshold is amount of errors a resolvers must experience in order to be regarded as failed.
@@ -157,7 +158,7 @@ func (info *ResolverInfo) DescriptiveName() string {
info.Name,
info.ID(),
)
case info.IP == nil:
case info.Domain != "":
return fmt.Sprintf(
"%s (%s)",
info.Domain,
@@ -183,6 +184,7 @@ func (info *ResolverInfo) Copy() *ResolverInfo {
Type: info.Type,
Source: info.Source,
IP: info.IP,
Domain: info.Domain,
IPScope: info.IPScope,
Port: info.Port,
id: info.id,