Skip to content

Fix time parsing and improve error logging

Scott French requested to merge work/swfrench/startup-improvements into main

Prior to this change, the 'release-time' config key was not correctly parsed, leaving ReleaseTime defaulted to time.Now() in cmd/root.go.

Specifically, viper does not automatically configure a string to Time DecodeHook, and the symptom of this (parse error) was missed since the return value of Unmarshal was unchecked.

This adds a hook for RFC 3339, while also surfacing errors reported by Unmarshal (and ReadInConfig while we're here).

To better support the latter, logging setup is moved into an initialize callback (note: these callbacks run after flag parsing). This allows more consistent use of structured logging throughout initialization.

Merge request reports

Loading