diff --git a/internal/pkg/powerdnsutils/powerdnsutils_dnsquery.go b/internal/pkg/powerdnsutils/powerdnsutils_dnsquery.go index 7f86ee77..259ada03 100644 --- a/internal/pkg/powerdnsutils/powerdnsutils_dnsquery.go +++ b/internal/pkg/powerdnsutils/powerdnsutils_dnsquery.go @@ -18,7 +18,7 @@ func GetZoneFilePerAXFR(address, zoneid string, readtimeout time.Duration) (stri func doZoneTransfer(zoneid string, address string, readtimeout time.Duration) (zonefile string, err error) { var conn net.Conn - var channel chan *dns.Envelope + var channel <-chan *dns.Envelope var d net.Dialer @@ -42,7 +42,7 @@ func doZoneTransfer(zoneid string, address string, readtimeout time.Duration) (z return } -func receiveAllRecords(channel chan *dns.Envelope) ([]dns.RR, error) { +func receiveAllRecords(channel <-chan *dns.Envelope) ([]dns.RR, error) { var answerrr []dns.RR for envmsg := range channel { diff --git a/pkg/microservice/logger/logger.go b/pkg/microservice/logger/logger.go index 6eb9e0f1..836a1fe1 100644 --- a/pkg/microservice/logger/logger.go +++ b/pkg/microservice/logger/logger.go @@ -9,14 +9,14 @@ import ( "github.com/rs/zerolog/log" ) -var signalchannel chan os.Signal //nolint:gochecknoglobals +var signalChannel chan<- os.Signal //nolint:gochecknoglobals // InitGlobalLogger set global logging settings. -func InitGlobalLogger(sigchannel chan os.Signal) { +func InitGlobalLogger(sigchannel chan<- os.Signal) { zerolog.TimeFieldFormat = time.RFC3339Nano zerolog.SetGlobalLevel(zerolog.InfoLevel) - signalchannel = sigchannel + signalChannel = sigchannel } // SetDefaultLogLevel with panic, fatal, error, warn, info, debug @@ -82,13 +82,13 @@ func ErrorLog(message string) { } func FatalLog(message string) { - signalchannel <- syscall.SIGINT + signalChannel <- syscall.SIGINT log.Log().Str("level", "fatal").Msg(message) } func PanicLog(message string) { - signalchannel <- syscall.SIGINT + signalChannel <- syscall.SIGINT log.Panic().Msg(message) } @@ -110,13 +110,13 @@ func ErrorErrLog(err error) { } func FatalErrLog(err error) { - signalchannel <- syscall.SIGINT + signalChannel <- syscall.SIGINT log.Log().Str("level", "fatal").Err(err).Msg("") } func PanicErrLog(err error) { - signalchannel <- syscall.SIGINT + signalChannel <- syscall.SIGINT log.Panic().Err(err).Msg("") } diff --git a/pkg/microservice/servicediscovery/servicediscovery.go b/pkg/microservice/servicediscovery/servicediscovery.go index 02147760..7c09aaa9 100644 --- a/pkg/microservice/servicediscovery/servicediscovery.go +++ b/pkg/microservice/servicediscovery/servicediscovery.go @@ -272,7 +272,7 @@ func (sd *ServiceDiscovery) PutValue(key string, value []byte) error { return err } -func (sd *ServiceDiscovery) SubscribeToKey(key string, valuechan chan []byte) { +func (sd *ServiceDiscovery) SubscribeToKey(key string, valuechan chan<- []byte) { actualIndex := uint64(0) go func() {