refactor: follow the google go style guide
Document every package and exported identifier, return the log level from NewLogger instead of keeping it in a package variable, and stop tests from mutating the argon2 parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
048e114fd9
commit
d20225982a
21 files changed
+147
-36
No files matched your search
@@ -1,3 +1,5 @@
|
||||
// Command statuspage serves public status pages, including on customer
|
||||
// domains.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -11,19 +13,21 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
log := platform.NewLogger("statuspage")
|
||||
if err := run(log); err != nil {
|
||||
log, level := platform.NewLogger("statuspage")
|
||||
// Route the standard log package and dependencies through the same handler.
|
||||
slog.SetDefault(log)
|
||||
if err := run(log, level); err != nil {
|
||||
log.Error("exit", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func run(log *slog.Logger) error {
|
||||
func run(log *slog.Logger, level *slog.LevelVar) error {
|
||||
cfg, err := config.Load[config.StatusPage]()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
platform.SetLogLevel(cfg.LogLevel)
|
||||
level.Set(cfg.LogLevel)
|
||||
ctx, stop := platform.SignalContext()
|
||||
defer stop()
|
||||
|
||||
|
||||
Reference in new issue
Block a user