summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-08 14:54:55 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-08 14:54:55 -0600
commit25e0c48d6d85d34d44f1e5fc418392d07b3d1cfe (patch)
treef88af97033ce6537a8753c1b1a562f9bef20d6f1
parent60f140913b593f0a63a4558ad54184d12a4c5f54 (diff)
linter fixes
-rw-r--r--config.go9
-rw-r--r--main.go6
2 files changed, 8 insertions, 7 deletions
diff --git a/config.go b/config.go
index f89ca6a..39d59bd 100644
--- a/config.go
+++ b/config.go
@@ -57,10 +57,11 @@ func dropPrivileges() (bool, error) {
func serverContext() (context.Context, logging.Logger, logging.Logger, logging.Logger, logging.Logger) {
debug, info, warn, err := logging.DefaultLoggers()
ctx := signals(context.Background())
- ctx = context.WithValue(ctx, "debuglog", debug)
- ctx = context.WithValue(ctx, "infolog", info)
- ctx = context.WithValue(ctx, "warnlog", warn)
- ctx = context.WithValue(ctx, "errorlog", err)
+ ctx = context.WithValue(ctx, "debuglog", debug) //nolint:staticcheck
+ ctx = context.WithValue(ctx, "infolog", info) //nolint:staticcheck
+ ctx = context.WithValue(ctx, "warnlog", warn) //nolint:staticcheck
+ ctx = context.WithValue(ctx, "errorlog", err) //nolint:staticcheck
+
return ctx, debug, info, warn, err
}
diff --git a/main.go b/main.go
index 12c5618..abdb907 100644
--- a/main.go
+++ b/main.go
@@ -23,7 +23,7 @@ func main() {
ctx, _, info, warn, errlog := serverContext()
if !dropped {
- warn.Log("msg", "dropping privileges to 'nobody' failed")
+ _ = warn.Log("msg", "dropping privileges to 'nobody' failed")
}
handler := logging.LogRequests(info)(geminiRouter(conf))
@@ -37,12 +37,12 @@ func main() {
gemTLS,
)
if err != nil {
- errlog.Log("msg", "error building server", "error", err)
+ _ = errlog.Log("msg", "error building server", "error", err)
os.Exit(1)
}
if err := server.Serve(); err != nil {
- errlog.Log("msg", "error serving gemini", "error", err)
+ _ = errlog.Log("msg", "error serving gemini", "error", err)
os.Exit(1)
}
}