From bea0a1bce37a73acb323269edeaa5b7d11a2b42d Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Thu, 16 May 2024 07:47:04 +0200 Subject: Fix nits spotted by go vet --- internal/feedback/feedback.go | 6 +++--- internal/logger/logger.go | 5 +++-- internal/manager/manager.go | 8 ++++---- internal/monitor/monitor.go | 12 ++++++------ 4 files changed, 16 insertions(+), 15 deletions(-) (limited to 'internal') diff --git a/internal/feedback/feedback.go b/internal/feedback/feedback.go index 77431e0..7501bbf 100644 --- a/internal/feedback/feedback.go +++ b/internal/feedback/feedback.go @@ -23,9 +23,9 @@ type Config struct { Policy policy.Policy // Optional - Logger logger.Logger // Debug and info prints only (no output by default) - PullInterval time.Duration // How often nodes are pulled via HTTP GET - HTTPTimeout time.Duration // Timeout to use when pulling nodes + Logger *logger.Logger // Debug and info prints only (no output by default) + PullInterval time.Duration // How often nodes are pulled via HTTP GET + HTTPTimeout time.Duration // Timeout to use when pulling nodes } type Feedback struct { diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 195ad3e..96f9f22 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -56,9 +56,10 @@ type Logger struct { mutex sync.Mutex } -func New(cfg Config) (l Logger) { +func New(cfg Config) *Logger { + l := Logger{} l.Reconfigure(cfg) - return + return &l } func (l *Logger) Reconfigure(cfg Config) { diff --git a/internal/manager/manager.go b/internal/manager/manager.go index ba7f1d0..bf1ad92 100644 --- a/internal/manager/manager.go +++ b/internal/manager/manager.go @@ -21,10 +21,10 @@ type Config struct { Directory string // Path to a directory where everything will be stored // Optional - Logger logger.Logger // Where to output messages and with what verbosity - AlertDelay time.Duration // Time before alerting on certificates that are unaccounted for - MetadataRefreshInterval time.Duration // How often to update the list of monitored logs - ShutdownTimeout time.Duration // Force shutdown after this timeout (FIXME: should not be needed) + Logger *logger.Logger // Where to output messages and with what verbosity + AlertDelay time.Duration // Time before alerting on certificates that are unaccounted for + MetadataRefreshInterval time.Duration // How often to update the list of monitored logs + ShutdownTimeout time.Duration // Force shutdown after this timeout (FIXME: should not be needed) } type Manager struct { diff --git a/internal/monitor/monitor.go b/internal/monitor/monitor.go index 121d853..12d93cf 100644 --- a/internal/monitor/monitor.go +++ b/internal/monitor/monitor.go @@ -61,12 +61,12 @@ type LogEntry struct { type Config struct { // Optional - Matcher Matcher // Which log entries to match (default is to match all) - Logger logger.Logger // Debug prints only (no output by default) - Contact string // Something that help log operators get in touch - ChunkSize uint // Min number of leaves to propagate a chunk without matches - BatchSize uint // Max number of certificates to accept per worker - NumWorkers uint // Number of parallel workers to use for each log + Matcher Matcher // Which log entries to match (default is to match all) + Logger *logger.Logger // Debug prints only (no output by default) + Contact string // Something that help log operators get in touch + ChunkSize uint // Min number of leaves to propagate a chunk without matches + BatchSize uint // Max number of certificates to accept per worker + NumWorkers uint // Number of parallel workers to use for each log } type Monitor struct { -- cgit v1.2.3