chore: fix linting errors (#8930)
Antonio Navarro Perez committed
May 4, 2022 at 17:02 UTC
afd11f1019f0c79a4a6f8b25cc4232239409cc58
4 files changed
+4
-2
commands/reqlog.go
+1
-1
@@ -42,7 +42,7 @@ func (rl *ReqLog) AddEntry(rle *ReqLogEntry) {
42
rl.nextID++
43
rl.Requests = append(rl.Requests, rle)
44
45
- if rle == nil || !rle.Active {
45
+ if !rle.Active {
46
rl.maybeCleanup()
47
}
48
}
core/commands/version.go
+1
-1
@@ -71,7 +71,7 @@ var VersionCmd = &cmds.Command{
71
return nil
72
}
73
74
- fmt.Fprint(w, fmt.Sprintf("ipfs version %s%s\n", version.Version, commitTxt))
74
+ fmt.Fprintf(w, "ipfs version %s%s\n", version.Version, commitTxt)
75
return nil
76
}),
77
},
core/coreapi/name.go
+1
@@ -75,6 +75,7 @@ func (api *NameAPI) Publish(ctx context.Context, p path.Path, opts ...caopts.Nam
75
}
76
77
if options.TTL != nil {
78
+ // nolint: staticcheck // non-backward compatible change
79
ctx = context.WithValue(ctx, "ipns-publish-ttl", *options.TTL)
80
}
81
core/corehttp/hostname.go
+1
@@ -249,6 +249,7 @@ func withHostnameContext(r *http.Request, hostname string) *http.Request {
249
// on subdomain and dnslink gateways. While DNSlink could read value from
250
// Host header, subdomain gateways have more comples rules (knownSubdomainDetails)
251
// More: https://github.com/ipfs/dir-index-html/issues/42
252
+ // nolint: staticcheck // non-backward compatible change
253
ctx := context.WithValue(r.Context(), "gw-hostname", hostname)
254
return r.WithContext(ctx)
255
}