From 4dd1a246da1b616747c86385cb69dc2cb5c4d466 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Wed, 4 May 2022 10:12:59 +0200 Subject: [PATCH] Fix linter problems on master. --- commands/reqlog.go | 2 +- core/commands/version.go | 2 +- core/coreapi/name.go | 1 + core/corehttp/hostname.go | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/reqlog.go b/commands/reqlog.go index cd52d75bf2f..14c10a7c0f8 100644 --- a/commands/reqlog.go +++ b/commands/reqlog.go @@ -42,7 +42,7 @@ func (rl *ReqLog) AddEntry(rle *ReqLogEntry) { rl.nextID++ rl.Requests = append(rl.Requests, rle) - if rle == nil || !rle.Active { + if !rle.Active { rl.maybeCleanup() } } diff --git a/core/commands/version.go b/core/commands/version.go index 70686da24dc..93ec5dd87a8 100644 --- a/core/commands/version.go +++ b/core/commands/version.go @@ -71,7 +71,7 @@ var VersionCmd = &cmds.Command{ return nil } - fmt.Fprint(w, fmt.Sprintf("ipfs version %s%s\n", version.Version, commitTxt)) + fmt.Fprintf(w, "ipfs version %s%s\n", version.Version, commitTxt) return nil }), }, diff --git a/core/coreapi/name.go b/core/coreapi/name.go index d2ef99bb338..e39c05d0f5f 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -75,6 +75,7 @@ func (api *NameAPI) Publish(ctx context.Context, p path.Path, opts ...caopts.Nam } if options.TTL != nil { + // nolint: staticcheck // non-backward compatible change ctx = context.WithValue(ctx, "ipns-publish-ttl", *options.TTL) } diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index 6c0ad5bca13..93dde67ab28 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -249,6 +249,7 @@ func withHostnameContext(r *http.Request, hostname string) *http.Request { // on subdomain and dnslink gateways. While DNSlink could read value from // Host header, subdomain gateways have more comples rules (knownSubdomainDetails) // More: https://github.com/ipfs/dir-index-html/issues/42 + // nolint: staticcheck // non-backward compatible change ctx := context.WithValue(r.Context(), "gw-hostname", hostname) return r.WithContext(ctx) }