Repository: prometheus/prometheus
Pull request #12271 (2023-04-18 09:18:55)

Update many Go dependencies
Ran `make update-go-deps` then hand-edited to remove any downgrades.

EDIT: removed Azure and Kubernetes updates.
EDIT 2: and kube-openapi, which doesn't compile with previous Go version.

bboreham: OK; maybe it waits on https://github.com/prometheus/prometheus/pull/11860?


Patch:
diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go
index 559203646..f4f6af20d 100644
--- a/cmd/prometheus/main.go
+++ b/cmd/prometheus/main.go
@@ -12,7 +12,6 @@
 // limitations under the License.
 
 // The main package for the Prometheus server executable.
-// nolint:revive // Many unsued function arguments in this file by design.
 package main
 
 import (
diff --git a/cmd/promtool/rules.go b/cmd/promtool/rules.go
index 43b76dbe4..aedc7bcb9 100644
--- a/cmd/promtool/rules.go
+++ b/cmd/promtool/rules.go
@@ -68,7 +68,7 @@ func newRuleImporter(logger log.Logger, config ruleImporterConfig, apiClient que
 }
 
 // loadGroups parses groups from a list of recording rule files.
-func (importer *ruleImporter) loadGroups(_ context.Context, filenames []string) (errs []error) {
+func (importer *ruleImporter) loadGroups(ctx context.Context, filenames []string) (errs []error) {
 	groups, errs := importer.ruleManager.LoadGroups(importer.config.evalInterval, labels.Labels{}, "", nil, filenames...)
 	if errs != nil {
 		return errs
diff --git a/cmd/promtool/tsdb.go b/cmd/promtool/tsdb.go
index 84aa43a9c..0e0cdb863 100644
--- a/cmd/promtool/tsdb.go
+++ b/cmd/promtool/tsdb.go
@@ -403,15 +403,14 @@ func openBlock(path, blockID string) (*tsdb.DBReadOnly, tsdb.BlockReader, error)
 		return nil, nil, err
 	}
 	var block tsdb.BlockReader
-	switch {
-	case blockID != "":
+	if blockID != "" {
 		for _, b := range blocks {
 			if b.Meta().ULID.String() == blockID {
 				block = b
 				break
 			}
 		}
-	case len(blocks) > 0:
+	} else if len(blocks) > 0 {
 		block = blocks[len(blocks)-1]
 	}
 	if block == nil {
diff --git a/discovery/aws/ec2.go b/discovery/aws/ec2.go
index 86d76627e..ca9921159 100644
--- a/discovery/aws/ec2.go
+++ b/discovery/aws/ec2.go
@@ -164,7 +164,7 @@ func NewEC2Discovery(conf *EC2SDConfig, logger log.Logger) *EC2Discovery {
 	return d
 }
 
-func (d *EC2Discovery) ec2Client(context.Context) (*ec2.EC2, error) {
+func (d *EC2Discovery) ec2Client(ctx context.Context) (*ec2.EC2, error) {
 	if d.ec2 != nil {
 		return d.ec2, nil
 	}
diff --git a/discovery/dns/dns.go b/discovery/dns/dns.go
index 96e07254f..2b11c242a 100644
--- a/discovery/dns/dns.go
+++ b/discovery/dns/dns.go
@@ -285,22 +285,21 @@ func lookupWithSearchPath(name string, qtype uint16, logger log.Logger) (*dns.Ms
 	for _, lname := range conf.NameList(name) {
 		response, err := lookupFromAnyServer(lname, qtype, conf, logger)
 
-		switch {
-		case err != nil:
+		if err != nil {
 			// We can't go home yet, because a later name
 			// may give us a valid, successful answer.  However
 			// we can no longer say "this name definitely doesn't
 			// exist", because we did not get that answer for
 			// at least one name.
 			allResponsesValid = false
-		case response.Rcode == dns.RcodeSuccess:
+		} else if response.Rcode == dns.RcodeSuccess {
 			// Outcome 1: GOLD!
 			return response, nil
 		}
 	}
 
 	if allResponsesValid {
-		// Outcome 2: everyone says NXDOMAIN, that's good enough for me.
+		// Outcome 2: everyone says NXDOMAIN, that's good enough for me
 		return &dns.Msg{}, nil
 	}
 	// Outcome 3: boned.
diff --git a/discovery/hetzner/hcloud.go b/discovery/hetzner/hcloud.go
index 50afdc1ec..aa406a1a7 100644
--- a/discovery/hetzner/hcloud.go
+++ b/discovery/hetzner/hcloud.go
@@ -59,7 +59,7 @@ type hcloudDiscovery struct {
 }
 
 // newHcloudDiscovery returns a new hcloudDiscovery which periodically refreshes its targets.
-func newHcloudDiscovery(conf *SDConfig, _ log.Logger) (*hcloudDiscovery, error) {
+func newHcloudDiscovery(conf *SDConfig, logger log.Logger) (*hcloudDiscovery, error) {
 	d := &hcloudDiscovery{
 		port: conf.Port,
 	}
diff --git a/discovery/hetzner/robot.go b/discovery/hetzner/robot.go
index 496088028..4b7abaf77 100644
--- a/discovery/hetzner/robot.go
+++ b/discovery/hetzner/robot.go
@@ -51,7 +51,7 @@ type robotDiscovery struct {
 }
 
 // newRobotDiscovery returns a new robotDiscovery which periodically refreshes its targets.
-func newRobotDiscovery(conf *SDConfig, _ log.Logger) (*robotDiscovery, error) {
+func newRobotDiscovery(conf *SDConfig, logger log.Logger) (*robotDiscovery, error) {
 	d := &robotDiscovery{
 		port:     conf.Port,
 		endpoint: conf.robotEndpoint,
@@ -69,7 +69,7 @@ func newRobotDiscovery(conf *SDConfig, _ log.Logger) (*robotDiscovery, error) {
 	return d, nil
 }
 
-func (d *robotDiscovery) refresh(context.Context) ([]*targetgroup.Group, error) {
+func (d *robotDiscovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
 	req, err := http.NewRequest("GET", d.endpoint+"/server", nil)
 	if err != nil {
 		return nil, err
diff --git a/discovery/ionos/server.go b/discovery/ionos/server.go
index a850fbbfb..8ac363970 100644
--- a/discovery/ionos/server.go
+++ b/discovery/ionos/server.go
@@ -60,7 +60,7 @@ type serverDiscovery struct {
 	datacenterID string
 }
 
-func newServerDiscovery(conf *SDConfig, _ log.Logger) (*serverDiscovery, error) {
+func newServerDiscovery(conf *SDConfig, logger log.Logger) (*serverDiscovery, error) {
 	d := &serverDiscovery{
 		port:         conf.Port,
 		datacenterID: conf.DatacenterID,
diff --git a/discovery/kubernetes/client_metrics.go b/discovery/kubernetes/client_metrics.go
index b316f7d88..3a33e3e8d 100644
--- a/discovery/kubernetes/client_metrics.go
+++ b/discovery/kubernetes/client_metrics.go
@@ -122,11 +122,11 @@ func (f *clientGoRequestMetricAdapter) Register(registerer prometheus.Registerer
 	)
 }
 
-func (clientGoRequestMetricAdapter) Increment(_ context.Context, code, _, _ string) {
+func (clientGoRequestMetricAdapter) Increment(ctx context.Context, code, method, host string) {
 	clientGoRequestResultMetricVec.WithLabelValues(code).Inc()
 }
 
-func (clientGoRequestMetricAdapter) Observe(_ context.Context, _ string, u url.URL, latency time.Duration) {
+func (clientGoRequestMetricAdapter) Observe(ctx context.Context, verb string, u url.URL, latency time.Duration) {
 	clientGoRequestLatencyMetricVec.WithLabelValues(u.EscapedPath()).Observe(latency.Seconds())
 }
 
@@ -169,7 +169,7 @@ func (f *clientGoWorkqueueMetricsProvider) NewLongestRunningProcessorSecondsMetr
 	return clientGoWorkqueueLongestRunningProcessorMetricVec.WithLabelValues(name)
 }
 
-func (clientGoWorkqueueMetricsProvider) NewRetriesMetric(string) workqueue.CounterMetric {
+func (clientGoWorkqueueMetricsProvider) NewRetriesMetric(name string) workqueue.CounterMetric {
 	// Retries are not used so the metric is omitted.
 	return noopMetric{}
 }
diff --git a/discovery/kubernetes/endpoints.go b/discovery/kubernetes/endpoints.go
index 27742ab46..039daf4fa 100644
--- a/discovery/kubernetes/endpoints.go
+++ b/discovery/kubernetes/endpoints.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many legitimately empty blocks in this file.
 package kubernetes
 
 import (
diff --git a/discovery/kubernetes/endpointslice.go b/discovery/kubernetes/endpointslice.go
index 29dc0be2f..135735154 100644
--- a/discovery/kubernetes/endpointslice.go
+++ b/discovery/kubernetes/endpointslice.go
@@ -190,7 +190,7 @@ func (e *EndpointSlice) Run(ctx context.Context, ch chan<- []*targetgroup.Group)
 	}
 
 	go func() {
-		for e.process(ctx, ch) { // nolint:revive
+		for e.process(ctx, ch) {
 		}
 	}()
 
diff --git a/discovery/kubernetes/ingress.go b/discovery/kubernetes/ingress.go
index ad47c341a..8c9249f54 100644
--- a/discovery/kubernetes/ingress.go
+++ b/discovery/kubernetes/ingress.go
@@ -89,7 +89,7 @@ func (i *Ingress) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
 	}
 
 	go func() {
-		for i.process(ctx, ch) { // nolint:revive
+		for i.process(ctx, ch) {
 		}
 	}()
 
diff --git a/discovery/kubernetes/kubernetes.go b/discovery/kubernetes/kubernetes.go
index a44bd513c..0f03e2cdb 100644
--- a/discovery/kubernetes/kubernetes.go
+++ b/discovery/kubernetes/kubernetes.go
@@ -299,13 +299,12 @@ func New(l log.Logger, conf *SDConfig) (*Discovery, error) {
 		err          error
 		ownNamespace string
 	)
-	switch {
-	case conf.KubeConfig != "":
+	if conf.KubeConfig != "" {
 		kcfg, err = clientcmd.BuildConfigFromFlags("", conf.KubeConfig)
 		if err != nil {
 			return nil, err
 		}
-	case conf.APIServer.URL == nil:
+	} else if conf.APIServer.URL == nil {
 		// Use the Kubernetes provided pod service account
 		// as described in https://kubernetes.io/docs/admin/service-accounts-admin/
 		kcfg, err = rest.InClusterConfig()
@@ -325,7 +324,7 @@ func New(l log.Logger, conf *SDConfig) (*Discovery, error) {
 		}
 
 		level.Info(l).Log("msg", "Using pod service account via in-cluster config")
-	default:
+	} else {
 		rt, err := config.NewRoundTripperFromConfig(conf.HTTPClientConfig, "kubernetes_sd")
 		if err != nil {
 			return nil, err
diff --git a/discovery/kubernetes/node.go b/discovery/kubernetes/node.go
index 16a06e7a0..93adf7825 100644
--- a/discovery/kubernetes/node.go
+++ b/discovery/kubernetes/node.go
@@ -96,7 +96,7 @@ func (n *Node) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
 	}
 
 	go func() {
-		for n.process(ctx, ch) { // nolint:revive
+		for n.process(ctx, ch) {
 		}
 	}()
 
diff --git a/discovery/kubernetes/pod.go b/discovery/kubernetes/pod.go
index 732cf52ad..396720c22 100644
--- a/discovery/kubernetes/pod.go
+++ b/discovery/kubernetes/pod.go
@@ -132,7 +132,7 @@ func (p *Pod) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
 	}
 
 	go func() {
-		for p.process(ctx, ch) { // nolint:revive
+		for p.process(ctx, ch) {
 		}
 	}()
 
diff --git a/discovery/kubernetes/service.go b/discovery/kubernetes/service.go
index 40e17679e..a19f06e7d 100644
--- a/discovery/kubernetes/service.go
+++ b/discovery/kubernetes/service.go
@@ -92,7 +92,7 @@ func (s *Service) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
 	}
 
 	go func() {
-		for s.process(ctx, ch) { // nolint:revive
+		for s.process(ctx, ch) {
 		}
 	}()
 
diff --git a/discovery/linode/linode.go b/discovery/linode/linode.go
index 449e13cd8..0fd0a2c37 100644
--- a/discovery/linode/linode.go
+++ b/discovery/linode/linode.go
@@ -250,20 +250,19 @@ func (d *Discovery) refreshData(ctx context.Context) ([]*targetgroup.Group, erro
 					continue
 				}
 
-				switch {
-				case detailedIP.Public && publicIPv4 == "":
+				if detailedIP.Public && publicIPv4 == "" {
 					publicIPv4 = detailedIP.Address
 
 					if detailedIP.RDNS != "" && detailedIP.RDNS != "null" {
 						publicIPv4RDNS = detailedIP.RDNS
 					}
-				case !detailedIP.Public && privateIPv4 == "":
+				} else if !detailedIP.Public && privateIPv4 == "" {
 					privateIPv4 = detailedIP.Address
 
 					if detailedIP.RDNS != "" && detailedIP.RDNS != "null" {
 						privateIPv4RDNS = detailedIP.RDNS
 					}
-				default:
+				} else {
 					extraIPs = append(extraIPs, detailedIP.Address)
 				}
 			}
diff --git a/discovery/marathon/marathon.go b/discovery/marathon/marathon.go
index cfd3e2c08..079f93ad0 100644
--- a/discovery/marathon/marathon.go
+++ b/discovery/marathon/marathon.go
@@ -136,10 +136,9 @@ func NewDiscovery(conf SDConfig, logger log.Logger) (*Discovery, error) {
 		return nil, err
 	}
 
-	switch {
-	case len(conf.AuthToken) > 0:
+	if len(conf.AuthToken) > 0 {
 		rt, err = newAuthTokenRoundTripper(conf.AuthToken, rt)
-	case len(conf.AuthTokenFile) > 0:
+	} else if len(conf.AuthTokenFile) > 0 {
 		rt, err = newAuthTokenFileRoundTripper(conf.AuthTokenFile, rt)
 	}
 	if err != nil {
@@ -401,20 +400,19 @@ func targetsForApp(app *app) []model.LabelSet {
 	var labels []map[string]string
 	var prefix string
 
-	switch {
-	case len(app.Container.PortMappings) != 0:
+	if len(app.Container.PortMappings) != 0 {
 		// In Marathon 1.5.x the "container.docker.portMappings" object was moved
 		// to "container.portMappings".
 		ports, labels = extractPortMapping(app.Container.PortMappings, app.isContainerNet())
 		prefix = portMappingLabelPrefix
 
-	case len(app.Container.Docker.PortMappings) != 0:
+	} else if len(app.Container.Docker.PortMappings) != 0 {
 		// Prior to Marathon 1.5 the port mappings could be found at the path
 		// "container.docker.portMappings".
 		ports, labels = extractPortMapping(app.Container.Docker.PortMappings, app.isContainerNet())
 		prefix = portMappingLabelPrefix
 
-	case len(app.PortDefinitions) != 0:
+	} else if len(app.PortDefinitions) != 0 {
 		// PortDefinitions deprecates the "ports" array and can be used to specify
 		// a list of ports with metadata in case a mapping is not required.
 		ports = make([]uint32, len(app.PortDefinitions))
diff --git a/discovery/nomad/nomad.go b/discovery/nomad/nomad.go
index 7013f0737..c8d513039 100644
--- a/discovery/nomad/nomad.go
+++ b/discovery/nomad/nomad.go
@@ -161,7 +161,7 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) {
 	return d, nil
 }
 
-func (d *Discovery) refresh(context.Context) ([]*targetgroup.Group, error) {
+func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
 	opts := &nomad.QueryOptions{
 		AllowStale: d.allowStale,
 	}
diff --git a/discovery/ovhcloud/dedicated_server.go b/discovery/ovhcloud/dedicated_server.go
index bb5dadcd7..aeb4eccbb 100644
--- a/discovery/ovhcloud/dedicated_server.go
+++ b/discovery/ovhcloud/dedicated_server.go
@@ -102,7 +102,7 @@ func (d *dedicatedServerDiscovery) getSource() string {
 	return fmt.Sprintf("%s_%s", d.config.Name(), d.getService())
 }
 
-func (d *dedicatedServerDiscovery) refresh(context.Context) ([]*targetgroup.Group, error) {
+func (d *dedicatedServerDiscovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
 	client, err := createClient(d.config)
 	if err != nil {
 		return nil, err
diff --git a/discovery/ovhcloud/vps.go b/discovery/ovhcloud/vps.go
index e2d1dee36..705b42b65 100644
--- a/discovery/ovhcloud/vps.go
+++ b/discovery/ovhcloud/vps.go
@@ -117,7 +117,7 @@ func (d *vpsDiscovery) getSource() string {
 	return fmt.Sprintf("%s_%s", d.config.Name(), d.getService())
 }
 
-func (d *vpsDiscovery) refresh(context.Context) ([]*targetgroup.Group, error) {
+func (d *vpsDiscovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
 	client, err := createClient(d.config)
 	if err != nil {
 		return nil, err
diff --git a/discovery/vultr/vultr.go b/discovery/vultr/vultr.go
index 42881d3c1..2f489e7d4 100644
--- a/discovery/vultr/vultr.go
+++ b/discovery/vultr/vultr.go
@@ -202,8 +202,10 @@ func (d *Discovery) listInstances(ctx context.Context) ([]govultr.Instance, erro
 
 		if meta.Links.Next == "" {
 			break
+		} else {
+			listOptions.Cursor = meta.Links.Next
+			continue
 		}
-		listOptions.Cursor = meta.Links.Next
 	}
 
 	return instances, nil
diff --git a/discovery/zookeeper/zookeeper.go b/discovery/zookeeper/zookeeper.go
index cadff5fd2..308d63a5f 100644
--- a/discovery/zookeeper/zookeeper.go
+++ b/discovery/zookeeper/zookeeper.go
@@ -193,7 +193,7 @@ func (d *Discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) {
 		}
 		for _, pathUpdate := range d.pathUpdates {
 			// Drain event channel in case the treecache leaks goroutines otherwise.
-			for range pathUpdate { // nolint:revive
+			for range pathUpdate {
 			}
 		}
 		d.conn.Close()
diff --git a/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go b/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go
index 959656aa8..fffbc9c2a 100644
--- a/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go
+++ b/documentation/examples/remote_storage/remote_storage_adapter/influxdb/client.go
@@ -290,14 +290,13 @@ func mergeSamples(a, b []prompb.Sample) []prompb.Sample {
 	result := make([]prompb.Sample, 0, len(a)+len(b))
 	i, j := 0, 0
 	for i < len(a) && j < len(b) {
-		switch {
-		case a[i].Timestamp < b[j].Timestamp:
+		if a[i].Timestamp < b[j].Timestamp {
 			result = append(result, a[i])
 			i++
-		case a[i].Timestamp > b[j].Timestamp:
+		} else if a[i].Timestamp > b[j].Timestamp {
 			result = append(result, b[j])
 			j++
-		default:
+		} else {
 			result = append(result, a[i])
 			i++
 			j++
diff --git a/go.mod b/go.mod
index 92cc3931c..7b309b03f 100644
--- a/go.mod
+++ b/go.mod
@@ -8,46 +8,46 @@ require (
 	github.com/Azure/go-autorest/autorest/adal v0.9.23
 	github.com/alecthomas/kingpin/v2 v2.3.2
 	github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137
-	github.com/aws/aws-sdk-go v1.44.217
+	github.com/aws/aws-sdk-go v1.44.245
 	github.com/cespare/xxhash/v2 v2.2.0
 	github.com/dennwc/varint v1.0.0
 	github.com/digitalocean/godo v1.98.0
-	github.com/docker/docker v23.0.1+incompatible
+	github.com/docker/docker v23.0.4+incompatible
 	github.com/edsrzf/mmap-go v1.1.0
 	github.com/envoyproxy/go-control-plane v0.11.0
-	github.com/envoyproxy/protoc-gen-validate v0.9.1
+	github.com/envoyproxy/protoc-gen-validate v0.10.1
 	github.com/fsnotify/fsnotify v1.6.0
 	github.com/go-kit/log v0.2.1
 	github.com/go-logfmt/logfmt v0.6.0
-	github.com/go-openapi/strfmt v0.21.3
+	github.com/go-openapi/strfmt v0.21.7
 	github.com/go-zookeeper/zk v1.0.3
 	github.com/gogo/protobuf v1.3.2
 	github.com/golang/snappy v0.0.4
-	github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10
-	github.com/gophercloud/gophercloud v1.2.0
+	github.com/google/pprof v0.0.0-20230406165453-00490a63f317
+	github.com/gophercloud/gophercloud v1.3.0
 	github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd
 	github.com/grpc-ecosystem/grpc-gateway v1.16.0
 	github.com/hashicorp/consul/api v1.20.0
-	github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b
-	github.com/hetznercloud/hcloud-go v1.41.0
-	github.com/ionos-cloud/sdk-go/v6 v6.1.5
+	github.com/hashicorp/nomad/api v0.0.0-20230418003350-3067191c5197
+	github.com/hetznercloud/hcloud-go v1.42.0
+	github.com/ionos-cloud/sdk-go/v6 v6.1.6
 	github.com/json-iterator/go v1.1.12
 	github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b
-	github.com/linode/linodego v1.14.1
+	github.com/linode/linodego v1.16.1
 	github.com/miekg/dns v1.1.53
 	github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
 	github.com/oklog/run v1.1.0
 	github.com/oklog/ulid v1.3.1
-	github.com/ovh/go-ovh v1.3.0
+	github.com/ovh/go-ovh v1.4.1
 	github.com/pkg/errors v0.9.1
 	github.com/prometheus/alertmanager v0.25.0
-	github.com/prometheus/client_golang v1.14.0
+	github.com/prometheus/client_golang v1.15.0
 	github.com/prometheus/client_model v0.3.0
 	github.com/prometheus/common v0.42.0
 	github.com/prometheus/common/assets v0.2.0
 	github.com/prometheus/common/sigv4 v0.1.0
 	github.com/prometheus/exporter-toolkit v0.9.1
-	github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14
+	github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15
 	github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
 	github.com/stretchr/testify v1.8.2
 	github.com/vultr/govultr/v2 v2.17.2
@@ -59,18 +59,18 @@ require (
 	go.opentelemetry.io/otel/sdk v1.14.0
 	go.opentelemetry.io/otel/trace v1.14.0
 	go.uber.org/atomic v1.10.0
-	go.uber.org/automaxprocs v1.5.1
+	go.uber.org/automaxprocs v1.5.2
 	go.uber.org/goleak v1.2.1
-	golang.org/x/net v0.8.0
-	golang.org/x/oauth2 v0.6.0
+	golang.org/x/net v0.9.0
+	golang.org/x/oauth2 v0.7.0
 	golang.org/x/sync v0.1.0
-	golang.org/x/sys v0.6.0
+	golang.org/x/sys v0.7.0
 	golang.org/x/time v0.3.0
-	golang.org/x/tools v0.7.0
+	golang.org/x/tools v0.8.0
 	google.golang.org/api v0.114.0
 	google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
 	google.golang.org/grpc v1.53.0
-	google.golang.org/protobuf v1.29.1
+	google.golang.org/protobuf v1.30.0
 	gopkg.in/yaml.v2 v2.4.0
 	gopkg.in/yaml.v3 v3.0.1
 	k8s.io/api v0.26.2
@@ -85,7 +85,7 @@ require (
 	github.com/coreos/go-systemd/v22 v22.5.0 // indirect
 	github.com/hashicorp/errwrap v1.1.0 // indirect
 	github.com/hashicorp/go-multierror v1.1.1 // indirect
-	github.com/rogpeppe/go-internal v1.9.0 // indirect
+	github.com/rogpeppe/go-internal v1.10.0 // indirect
 	github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
 )
 
@@ -166,16 +166,16 @@ require (
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/prometheus/procfs v0.9.0 // indirect
 	github.com/spf13/pflag v1.0.5 // indirect
-	go.mongodb.org/mongo-driver v1.11.2 // indirect
+	go.mongodb.org/mongo-driver v1.11.3 // indirect
 	go.opencensus.io v0.24.0 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
 	go.opentelemetry.io/otel/metric v0.37.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
 	golang.org/x/crypto v0.7.0 // indirect
-	golang.org/x/exp v0.0.0-20230307190834-24139beb5833
-	golang.org/x/mod v0.9.0 // indirect
-	golang.org/x/term v0.6.0 // indirect
-	golang.org/x/text v0.8.0 // indirect
+	golang.org/x/exp v0.0.0-20230321023759-10a507213a29
+	golang.org/x/mod v0.10.0 // indirect
+	golang.org/x/term v0.7.0 // indirect
+	golang.org/x/text v0.9.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/ini.v1 v1.67.0 // indirect
diff --git a/go.sum b/go.sum
index 7ea1be034..c699aa9df 100644
--- a/go.sum
+++ b/go.sum
@@ -98,8 +98,8 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:W
 github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
 github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
 github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
-github.com/aws/aws-sdk-go v1.44.217 h1:FcWC56MRl+k756aH3qeMQTylSdeJ58WN0iFz3fkyRz0=
-github.com/aws/aws-sdk-go v1.44.217/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.245 h1:KtY2s4q31/kn33AdV63R5t77mdxsI7rq3YT7Mgo805M=
+github.com/aws/aws-sdk-go v1.44.245/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
 github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
@@ -154,8 +154,8 @@ github.com/digitalocean/godo v1.98.0/go.mod h1:NRpFznZFvhHjBoqZAaOD3khVzsJ3EibzK
 github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
 github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
 github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
-github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY=
-github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v23.0.4+incompatible h1:Kd3Bh9V/rO+XpTP/BLqM+gx8z7+Yb0AA2Ibj+nNo4ek=
+github.com/docker/docker v23.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
 github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
 github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -180,8 +180,8 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.
 github.com/envoyproxy/go-control-plane v0.11.0 h1:jtLewhRR2vMRNnq2ZZUoCjUlgut+Y0+sDDWPOfwOi1o=
 github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY=
-github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w=
+github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8=
+github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
 github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
 github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
@@ -245,8 +245,9 @@ github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxR
 github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
 github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg=
 github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k=
-github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o=
 github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg=
+github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k=
+github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew=
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
 github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
 github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
@@ -366,8 +367,8 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf
 github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso=
-github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk=
+github.com/google/pprof v0.0.0-20230406165453-00490a63f317 h1:hFhpt7CTmR3DX+b4R19ydQFtofxT0Sv3QsKNMVQYTMQ=
+github.com/google/pprof v0.0.0-20230406165453-00490a63f317/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -380,8 +381,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
 github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
 github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A=
 github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI=
-github.com/gophercloud/gophercloud v1.2.0 h1:1oXyj4g54KBg/kFtCdMM6jtxSzeIyg8wv4z1HoGPp1E=
-github.com/gophercloud/gophercloud v1.2.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
+github.com/gophercloud/gophercloud v1.3.0 h1:RUKyCMiZoQR3VlVR5E3K7PK1AC3/qppsWYo6dtBiqs8=
+github.com/gophercloud/gophercloud v1.3.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
 github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
@@ -450,13 +451,13 @@ github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/
 github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
 github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM=
 github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0=
-github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b h1:EkuSTU8c/63q4LMayj8ilgg/4I5PXDFVcnqKfs9qcwI=
-github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b/go.mod h1:bKUb1ytds5KwUioHdvdq9jmrDqCThv95si0Ub7iNeBg=
+github.com/hashicorp/nomad/api v0.0.0-20230418003350-3067191c5197 h1:I5xhKLePXpXgM6pZ4xZNTiurLLS3sGuZrZFFzAbM67A=
+github.com/hashicorp/nomad/api v0.0.0-20230418003350-3067191c5197/go.mod h1:2TCrNvonL09r7EiQ6M2rNt+Cmjbn1QbzchFoTWJFpj4=
 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
 github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=
 github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
-github.com/hetznercloud/hcloud-go v1.41.0 h1:KJGFRRc68QiVu4PrEP5BmCQVveCP2CM26UGQUKGpIUs=
-github.com/hetznercloud/hcloud-go v1.41.0/go.mod h1:NaHg47L6C77mngZhwBG652dTAztYrsZ2/iITJKhQkHA=
+github.com/hetznercloud/hcloud-go v1.42.0 h1:Es/CDOForQN3nOOP5Vxh1N/YHjpCg386iYEX5zCgi+A=
+github.com/hetznercloud/hcloud-go v1.42.0/go.mod h1:YADL8AbmQYH0Eo+1lkuyoc8LutT0UeMvaKP47nNUb+Y=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -464,8 +465,9 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
 github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
-github.com/ionos-cloud/sdk-go/v6 v6.1.5 h1:BFqThLOgrGJWeo7w6UDyYuNxyi/GqEmNPl7C/YcQ8Fw=
-github.com/ionos-cloud/sdk-go/v6 v6.1.5/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k=
+github.com/ionos-cloud/sdk-go/v6 v6.1.6 h1:0n4irdqNska+1s3YMCRhrAqKbibEgQ7SwwhAlHzYT5A=
+github.com/ionos-cloud/sdk-go/v6 v6.1.6/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k=
+github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc=
 github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
 github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
 github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
@@ -513,8 +515,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
 github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
-github.com/linode/linodego v1.14.1 h1:uGxQyy0BidoEpLGdvfi4cPgEW+0YUFsEGrLEhcTfjNc=
-github.com/linode/linodego v1.14.1/go.mod h1:NJlzvlNtdMRRkXb0oN6UWzUkj6t+IBsyveHgZ5Ppjyk=
+github.com/linode/linodego v1.16.1 h1:5otq57M4PdHycPERRfSFZ0s1yz1ETVWGjCp3hh7+F9w=
+github.com/linode/linodego v1.16.1/go.mod h1:aESRAbpLY9R6IA1WGAWHikRI9DU9Lhesapv1MhKmPHM=
 github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@@ -543,6 +545,7 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
 github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g=
 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
 github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
 github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
@@ -614,8 +617,8 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
 github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
-github.com/ovh/go-ovh v1.3.0 h1:mvZaddk4E4kLcXhzb+cxBsMPYp2pHqiQpWYkInsuZPQ=
-github.com/ovh/go-ovh v1.3.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA=
+github.com/ovh/go-ovh v1.4.1 h1:VBGa5wMyQtTP7Zb+w97zRCh9sLtM/2YKRyy+MEJmWaM=
+github.com/ovh/go-ovh v1.4.1/go.mod h1:6bL6pPyUT7tBfI0pqOegJgRjgjuO+mOo+MyXd1EEC0M=
 github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
@@ -644,8 +647,8 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD
 github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
 github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
 github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
-github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
+github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM=
+github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -683,16 +686,16 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
 github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
-github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
-github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14 h1:yFl3jyaSVLNYXlnNYM5z2pagEk1dYQhfr1p20T1NyKY=
-github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
+github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15 h1:Y7xOFbD+3jaPw+VN7lkakNJ/pa+ZSQVFp1ONtJaBxns=
+github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
-github.com/shoenig/test v0.6.2 h1:tdq+WGnznwE5xcOMXkqqXuudK75RkSGBazBGcP1lX6w=
+github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c=
 github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
 github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
@@ -766,8 +769,8 @@ go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mI
 go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg=
 go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng=
 go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8=
-go.mongodb.org/mongo-driver v1.11.2 h1:+1v2rDQUWNcGW7/7E0Jvdz51V38XXxJfhzbV17aNHCw=
-go.mongodb.org/mongo-driver v1.11.2/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8=
+go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y=
+go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
 go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
@@ -802,8 +805,8 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
 go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
 go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
-go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk=
-go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU=
+go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME=
+go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
 go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
 go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
 go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
@@ -839,8 +842,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
 golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s=
-golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
+golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
+golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
 golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -862,8 +865,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
 golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
-golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -911,8 +914,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
+golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -920,8 +923,8 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr
 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=
-golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
+golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
+golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -1003,14 +1006,14 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
-golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
+golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
-golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
-golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
+golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
+golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1021,8 +1024,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
-golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1082,8 +1085,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
 golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
-golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
+golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
+golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1183,8 +1186,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM=
-google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -1198,7 +1201,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
 gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
 gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
 gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
diff --git a/model/histogram/float_histogram.go b/model/histogram/float_histogram.go
index f95f0051c..cd73083bb 100644
--- a/model/histogram/float_histogram.go
+++ b/model/histogram/float_histogram.go
@@ -824,11 +824,10 @@ mergeLoop: // Merge together all buckets from the original schema that fall into
 			origIdx += span.Offset
 		}
 		currIdx := i.targetIdx(origIdx)
-		switch {
-		case firstPass:
+		if firstPass {
 			i.currIdx = currIdx
 			firstPass = false
-		case currIdx != i.currIdx:
+		} else if currIdx != i.currIdx {
 			// Reached next bucket in targetSchema.
 			// Do not actually forward to the next bucket, but break out.
 			break mergeLoop
diff --git a/model/labels/labels.go b/model/labels/labels.go
index 93524ddcf..b7398d17f 100644
--- a/model/labels/labels.go
+++ b/model/labels/labels.go
@@ -169,12 +169,11 @@ func (ls Labels) HashForLabels(b []byte, names ...string) (uint64, []byte) {
 	b = b[:0]
 	i, j := 0, 0
 	for i < len(ls) && j < len(names) {
-		switch {
-		case names[j] < ls[i].Name:
+		if names[j] < ls[i].Name {
 			j++
-		case ls[i].Name < names[j]:
+		} else if ls[i].Name < names[j] {
 			i++
-		default:
+		} else {
 			b = append(b, ls[i].Name...)
 			b = append(b, seps[0])
 			b = append(b, ls[i].Value...)
@@ -214,12 +213,11 @@ func (ls Labels) BytesWithLabels(buf []byte, names ...string) []byte {
 	b.WriteByte(labelSep)
 	i, j := 0, 0
 	for i < len(ls) && j < len(names) {
-		switch {
-		case names[j] < ls[i].Name:
+		if names[j] < ls[i].Name {
 			j++
-		case ls[i].Name < names[j]:
+		} else if ls[i].Name < names[j] {
 			i++
-		default:
+		} else {
 			if b.Len() > 1 {
 				b.WriteByte(seps[0])
 			}
diff --git a/model/labels/labels_string.go b/model/labels/labels_string.go
index ff46103eb..f293c9167 100644
--- a/model/labels/labels_string.go
+++ b/model/labels/labels_string.go
@@ -56,14 +56,8 @@ func (ls labelSlice) Swap(i, j int)      { ls[i], ls[j] = ls[j], ls[i] }
 func (ls labelSlice) Less(i, j int) bool { return ls[i].Name < ls[j].Name }
 
 func decodeSize(data string, index int) (int, int) {
-	// Fast-path for common case of a single byte, value 0..127.
-	b := data[index]
-	index++
-	if b < 0x80 {
-		return int(b), index
-	}
-	size := int(b & 0x7F)
-	for shift := uint(7); ; shift += 7 {
+	var size int
+	for shift := uint(0); ; shift += 7 {
 		// Just panic if we go of the end of data, since all Labels strings are constructed internally and
 		// malformed data indicates a bug, or memory corruption.
 		b := data[index]
diff --git a/model/textparse/promparse.go b/model/textparse/promparse.go
index 94338a666..2c981f050 100644
--- a/model/textparse/promparse.go
+++ b/model/textparse/promparse.go
@@ -238,10 +238,9 @@ func (p *PromParser) Metric(l *labels.Labels) string {
 	return s
 }
 
-// Exemplar implements the Parser interface. However, since the classic
-// Prometheus text format does not support exemplars, this implementation simply
-// returns false and does nothing else.
-func (p *PromParser) Exemplar(*exemplar.Exemplar) bool {
+// Exemplar writes the exemplar of the current sample into the passed
+// exemplar. It returns if an exemplar exists.
+func (p *PromParser) Exemplar(e *exemplar.Exemplar) bool {
 	return false
 }
 
diff --git a/promql/engine.go b/promql/engine.go
index 1f493f129..b49be244f 100644
--- a/promql/engine.go
+++ b/promql/engine.go
@@ -400,7 +400,7 @@ func (ng *Engine) SetQueryLogger(l QueryLogger) {
 }
 
 // NewInstantQuery returns an evaluation query for the given expression at the given time.
-func (ng *Engine) NewInstantQuery(_ context.Context, q storage.Queryable, opts *QueryOpts, qs string, ts time.Time) (Query, error) {
+func (ng *Engine) NewInstantQuery(q storage.Queryable, opts *QueryOpts, qs string, ts time.Time) (Query, error) {
 	expr, err := parser.ParseExpr(qs)
 	if err != nil {
 		return nil, err
@@ -416,7 +416,7 @@ func (ng *Engine) NewInstantQuery(_ context.Context, q storage.Queryable, opts *
 
 // NewRangeQuery returns an evaluation query for the given time range and with
 // the resolution set by the interval.
-func (ng *Engine) NewRangeQuery(_ context.Context, q storage.Queryable, opts *QueryOpts, qs string, start, end time.Time, interval time.Duration) (Query, error) {
+func (ng *Engine) NewRangeQuery(q storage.Queryable, opts *QueryOpts, qs string, start, end time.Time, interval time.Duration) (Query, error) {
 	expr, err := parser.ParseExpr(qs)
 	if err != nil {
 		return nil, err
@@ -1957,7 +1957,7 @@ func (ev *evaluator) matrixIterSlice(
 		//   (b) the number of samples is relatively small.
 		// so a linear search will be as fast as a binary search.
 		var drop int
-		for drop = 0; floats[drop].T < mint; drop++ { // nolint:revive
+		for drop = 0; floats[drop].T < mint; drop++ {
 		}
 		ev.currentSamples -= drop
 		copy(floats, floats[drop:])
@@ -1979,7 +1979,7 @@ func (ev *evaluator) matrixIterSlice(
 		//   (b) the number of samples is relatively small.
 		// so a linear search will be as fast as a binary search.
 		var drop int
-		for drop = 0; histograms[drop].T < mint; drop++ { // nolint:revive
+		for drop = 0; histograms[drop].T < mint; drop++ {
 		}
 		ev.currentSamples -= drop
 		copy(histograms, histograms[drop:])
@@ -2096,13 +2096,13 @@ func (ev *evaluator) VectorAnd(lhs, rhs Vector, matching *parser.VectorMatching,
 }
 
 func (ev *evaluator) VectorOr(lhs, rhs Vector, matching *parser.VectorMatching, lhsh, rhsh []EvalSeriesHelper, enh *EvalNodeHelper) Vector {
-	switch {
-	case matching.Card != parser.CardManyToMany:
+	if matching.Card != parser.CardManyToMany {
 		panic("set operations must only use many-to-many matching")
-	case len(lhs) == 0: // Short-circuit.
+	}
+	if len(lhs) == 0 { // Short-circuit.
 		enh.Out = append(enh.Out, rhs...)
 		return enh.Out
-	case len(rhs) == 0:
+	} else if len(rhs) == 0 {
 		enh.Out = append(enh.Out, lhs...)
 		return enh.Out
 	}
@@ -2221,14 +2221,13 @@ func (ev *evaluator) VectorBinop(op parser.ItemType, lhs, rhs Vector, matching *
 			hl, hr = hr, hl
 		}
 		floatValue, histogramValue, keep := vectorElemBinop(op, fl, fr, hl, hr)
-		switch {
-		case returnBool:
+		if returnBool {
 			if keep {
 				floatValue = 1.0
 			} else {
 				floatValue = 0.0
 			}
-		case !keep:
+		} else if !keep {
 			continue
 		}
 		metric := resultMetric(ls.Metric, rs.Metric, op, matching, enh)
@@ -2515,15 +2514,14 @@ func (ev *evaluator) aggregation(op parser.ItemType, grouping []string, without
 		if !ok {
 			var m labels.Labels
 			enh.resetBuilder(metric)
-			switch {
-			case without:
+			if without {
 				enh.lb.Del(grouping...)
 				enh.lb.Del(labels.MetricName)
 				m = enh.lb.Labels()
-			case len(grouping) > 0:
+			} else if len(grouping) > 0 {
 				enh.lb.Keep(grouping...)
 				m = enh.lb.Labels()
-			default:
+			} else {
 				m = labels.EmptyLabels()
 			}
 			newAgg := &groupedAggregation{
@@ -2532,10 +2530,9 @@ func (ev *evaluator) aggregation(op parser.ItemType, grouping []string, without
 				mean:       s.F,
 				groupCount: 1,
 			}
-			switch {
-			case s.H == nil:
+			if s.H == nil {
 				newAgg.hasFloat = true
-			case op == parser.SUM:
+			} else if op == parser.SUM {
 				newAgg.histogramValue = s.H.Copy()
 				newAgg.hasHistogram = true
 			}
@@ -2545,10 +2542,9 @@ func (ev *evaluator) aggregation(op parser.ItemType, grouping []string, without
 
 			inputVecLen := int64(len(vec))
 			resultSize := k
-			switch {
-			case k > inputVecLen:
+			if k > inputVecLen {
 				resultSize = inputVecLen
-			case k == 0:
+			} else if k == 0 {
 				resultSize = 1
 			}
 			switch op {
@@ -2641,13 +2637,12 @@ func (ev *evaluator) aggregation(op parser.ItemType, grouping []string, without
 
 		case parser.TOPK:
 			// We build a heap of up to k elements, with the smallest element at heap[0].
-			switch {
-			case int64(len(group.heap)) < k:
+			if int64(len(group.heap)) < k {
 				heap.Push(&group.heap, &Sample{
 					F:      s.F,
 					Metric: s.Metric,
 				})
-			case group.heap[0].F < s.F || (math.IsNaN(group.heap[0].F) && !math.IsNaN(s.F)):
+			} else if group.heap[0].F < s.F || (math.IsNaN(group.heap[0].F) && !math.IsNaN(s.F)) {
 				// This new element is bigger than the previous smallest element - overwrite that.
 				group.heap[0] = Sample{
 					F:      s.F,
@@ -2660,13 +2655,12 @@ func (ev *evaluator) aggregation(op parser.ItemType, grouping []string, without
 
 		case parser.BOTTOMK:
 			// We build a heap of up to k elements, with the biggest element at heap[0].
-			switch {
-			case int64(len(group.reverseHeap)) < k:
+			if int64(len(group.reverseHeap)) < k {
 				heap.Push(&group.reverseHeap, &Sample{
 					F:      s.F,
 					Metric: s.Metric,
 				})
-			case group.reverseHeap[0].F > s.F || (math.IsNaN(group.reverseHeap[0].F) && !math.IsNaN(s.F)):
+			} else if group.reverseHeap[0].F > s.F || (math.IsNaN(group.reverseHeap[0].F) && !math.IsNaN(s.F)) {
 				// This new element is smaller than the previous biggest element - overwrite that.
 				group.reverseHeap[0] = Sample{
 					F:      s.F,
@@ -2825,10 +2819,9 @@ func PreprocessExpr(expr parser.Expr, start, end time.Time) parser.Expr {
 func preprocessExprHelper(expr parser.Expr, start, end time.Time) bool {
 	switch n := expr.(type) {
 	case *parser.VectorSelector:
-		switch n.StartOrEnd {
-		case parser.START:
+		if n.StartOrEnd == parser.START {
 			n.Timestamp = makeInt64Pointer(timestamp.FromTime(start))
-		case parser.END:
+		} else if n.StartOrEnd == parser.END {
 			n.Timestamp = makeInt64Pointer(timestamp.FromTime(end))
 		}
 		return n.Timestamp != nil
@@ -2885,10 +2878,9 @@ func preprocessExprHelper(expr parser.Expr, start, end time.Time) bool {
 		if isInvariant {
 			n.Expr = newStepInvariantExpr(n.Expr)
 		}
-		switch n.StartOrEnd {
-		case parser.START:
+		if n.StartOrEnd == parser.START {
 			n.Timestamp = makeInt64Pointer(timestamp.FromTime(start))
-		case parser.END:
+		} else if n.StartOrEnd == parser.END {
 			n.Timestamp = makeInt64Pointer(timestamp.FromTime(end))
 		}
 		return n.Timestamp != nil
diff --git a/promql/functions.go b/promql/functions.go
index 2983de4fd..fd99703df 100644
--- a/promql/functions.go
+++ b/promql/functions.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many unsued function arguments in this file by design.
 package promql
 
 import (
@@ -804,14 +803,12 @@ func funcPi(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) V
 // === sgn(Vector parser.ValueTypeVector) Vector ===
 func funcSgn(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) Vector {
 	return simpleFunc(vals, enh, func(v float64) float64 {
-		switch {
-		case v < 0:
+		if v < 0 {
 			return -1
-		case v > 0:
+		} else if v > 0 {
 			return 1
-		default:
-			return v
 		}
+		return v
 	})
 }
 
diff --git a/promql/parser/ast.go b/promql/parser/ast.go
index f156fc602..190af2d59 100644
--- a/promql/parser/ast.go
+++ b/promql/parser/ast.go
@@ -368,14 +368,13 @@ func Children(node Node) []Node {
 	case *AggregateExpr:
 		// While this does not look nice, it should avoid unnecessary allocations
 		// caused by slice resizing
-		switch {
-		case n.Expr == nil && n.Param == nil:
+		if n.Expr == nil && n.Param == nil {
 			return nil
-		case n.Expr == nil:
+		} else if n.Expr == nil {
 			return []Node{n.Param}
-		case n.Param == nil:
+		} else if n.Param == nil {
 			return []Node{n.Expr}
-		default:
+		} else {
 			return []Node{n.Expr, n.Param}
 		}
 	case *BinaryExpr:
diff --git a/promql/parser/lex.go b/promql/parser/lex.go
index fe5a8abfe..7b6a6b027 100644
--- a/promql/parser/lex.go
+++ b/promql/parser/lex.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many legitimately empty blocks in this file.
 package parser
 
 import (
@@ -294,7 +293,7 @@ func (l *Lexer) accept(valid string) bool {
 // acceptRun consumes a run of runes from the valid set.
 func (l *Lexer) acceptRun(valid string) {
 	for strings.ContainsRune(valid, l.next()) {
-		// Consume.
+		// consume
 	}
 	l.backup()
 }
@@ -347,10 +346,9 @@ func lexStatements(l *Lexer) stateFn {
 
 	switch r := l.next(); {
 	case r == eof:
-		switch {
-		case l.parenDepth != 0:
+		if l.parenDepth != 0 {
 			return l.errorf("unclosed left parenthesis")
-		case l.bracketOpen:
+		} else if l.bracketOpen {
 			return l.errorf("unclosed left bracket")
 		}
 		l.emit(EOF)
@@ -372,13 +370,12 @@ func lexStatements(l *Lexer) stateFn {
 	case r == '^':
 		l.emit(POW)
 	case r == '=':
-		switch t := l.peek(); t {
-		case '=':
+		if t := l.peek(); t == '=' {
 			l.next()
 			l.emit(EQLC)
-		case '~':
+		} else if t == '~' {
 			return l.errorf("unexpected character after '=': %q", t)
-		default:
+		} else {
 			l.emit(EQL)
 		}
 	case r == '!':
@@ -793,12 +790,11 @@ Loop:
 		default:
 			l.backup()
 			word := l.input[l.start:l.pos]
-			switch kw, ok := key[strings.ToLower(word)]; {
-			case ok:
+			if kw, ok := key[strings.ToLower(word)]; ok {
 				l.emit(kw)
-			case !strings.Contains(word, ":"):
+			} else if !strings.Contains(word, ":") {
 				l.emit(IDENTIFIER)
-			default:
+			} else {
 				l.emit(METRIC_IDENTIFIER)
 			}
 			break Loop
diff --git a/promql/parser/parse.go b/promql/parser/parse.go
index e69ed4595..6c37ce6fc 100644
--- a/promql/parser/parse.go
+++ b/promql/parser/parse.go
@@ -270,15 +270,14 @@ var errUnexpected = errors.New("unexpected error")
 // recover is the handler that turns panics into returns from the top level of Parse.
 func (p *parser) recover(errp *error) {
 	e := recover()
-	switch _, ok := e.(runtime.Error); {
-	case ok:
+	if _, ok := e.(runtime.Error); ok {
 		// Print the stack trace but do not inhibit the running application.
 		buf := make([]byte, 64<<10)
 		buf = buf[:runtime.Stack(buf, false)]
 
 		fmt.Fprintf(os.Stderr, "parser panic: %v\n%s", e, buf)
 		*errp = errUnexpected
-	case e != nil:
+	} else if e != nil {
 		*errp = e.(error)
 	}
 }
@@ -333,7 +332,7 @@ func (p *parser) Lex(lval *yySymType) int {
 // It is a no-op since the parsers error routines are triggered
 // by mechanisms that allow more fine-grained control
 // For more information, see https://pkg.go.dev/golang.org/x/tools/cmd/goyacc.
-func (p *parser) Error(string) {
+func (p *parser) Error(e string) {
 }
 
 // InjectItem allows injecting a single Item at the beginning of the token stream
@@ -482,9 +481,9 @@ func (p *parser) checkAST(node Node) (typ ValueType) {
 		// This is made a function instead of a variable, so it is lazily evaluated on demand.
 		opRange := func() (r PositionRange) {
 			// Remove whitespace at the beginning and end of the range.
-			for r.Start = n.LHS.PositionRange().End; isSpace(rune(p.lex.input[r.Start])); r.Start++ { // nolint:revive
+			for r.Start = n.LHS.PositionRange().End; isSpace(rune(p.lex.input[r.Start])); r.Start++ {
 			}
-			for r.End = n.RHS.PositionRange().Start - 1; isSpace(rune(p.lex.input[r.End])); r.End-- { // nolint:revive
+			for r.End = n.RHS.PositionRange().Start - 1; isSpace(rune(p.lex.input[r.End])); r.End-- {
 			}
 			return
 		}
@@ -519,18 +518,20 @@ func (p *parser) checkAST(node Node) (typ ValueType) {
 			p.addParseErrf(n.RHS.PositionRange(), "binary expression must contain only scalar and instant vector types")
 		}
 
-		switch {
-		case (lt != ValueTypeVector || rt != ValueTypeVector) && n.VectorMatching != nil:
+		if (lt != ValueTypeVector || rt != ValueTypeVector) && n.VectorMatching != nil {
 			if len(n.VectorMatching.MatchingLabels) > 0 {
 				p.addParseErrf(n.PositionRange(), "vector matching only allowed between instant vectors")
 			}
 			n.VectorMatching = nil
-		case n.Op.IsSetOperator(): // Both operands are Vectors.
-			if n.VectorMatching.Card == CardOneToMany || n.VectorMatching.Card == CardManyToOne {
-				p.addParseErrf(n.PositionRange(), "no grouping allowed for %q operation", n.Op)
-			}
-			if n.VectorMatching.Card != CardManyToMany {
-				p.addParseErrf(n.PositionRange(), "set operations must always be many-to-many")
+		} else {
+			// Both operands are Vectors.
+			if n.Op.IsSetOperator() {
+				if n.VectorMatching.Card == CardOneToMany || n.VectorMatching.Card == CardManyToOne {
+					p.addParseErrf(n.PositionRange(), "no grouping allowed for %q operation", n.Op)
+				}
+				if n.VectorMatching.Card != CardManyToMany {
+					p.addParseErrf(n.PositionRange(), "set operations must always be many-to-many")
+				}
 			}
 		}
 
@@ -707,10 +708,9 @@ func (p *parser) addOffset(e Node, offset time.Duration) {
 	}
 
 	// it is already ensured by parseDuration func that there never will be a zero offset modifier
-	switch {
-	case *orgoffsetp != 0:
+	if *orgoffsetp != 0 {
 		p.addParseErrf(e.PositionRange(), "offset may not be set multiple times")
-	case orgoffsetp != nil:
+	} else if orgoffsetp != nil {
 		*orgoffsetp = offset
 	}
 
diff --git a/promql/parser/printer.go b/promql/parser/printer.go
index ff171f215..1f15eeef3 100644
--- a/promql/parser/printer.go
+++ b/promql/parser/printer.go
@@ -124,19 +124,17 @@ func (node *MatrixSelector) String() string {
 	// Copy the Vector selector before changing the offset
 	vecSelector := *node.VectorSelector.(*VectorSelector)
 	offset := ""
-	switch {
-	case vecSelector.OriginalOffset > time.Duration(0):
+	if vecSelector.OriginalOffset > time.Duration(0) {
 		offset = fmt.Sprintf(" offset %s", model.Duration(vecSelector.OriginalOffset))
-	case vecSelector.OriginalOffset < time.Duration(0):
+	} else if vecSelector.OriginalOffset < time.Duration(0) {
 		offset = fmt.Sprintf(" offset -%s", model.Duration(-vecSelector.OriginalOffset))
 	}
 	at := ""
-	switch {
-	case vecSelector.Timestamp != nil:
+	if vecSelector.Timestamp != nil {
 		at = fmt.Sprintf(" @ %.3f", float64(*vecSelector.Timestamp)/1000.0)
-	case vecSelector.StartOrEnd == START:
+	} else if vecSelector.StartOrEnd == START {
 		at = " @ start()"
-	case vecSelector.StartOrEnd == END:
+	} else if vecSelector.StartOrEnd == END {
 		at = " @ end()"
 	}
 
@@ -164,19 +162,17 @@ func (node *SubqueryExpr) getSubqueryTimeSuffix() string {
 		step = model.Duration(node.Step).String()
 	}
 	offset := ""
-	switch {
-	case node.OriginalOffset > time.Duration(0):
+	if node.OriginalOffset > time.Duration(0) {
 		offset = fmt.Sprintf(" offset %s", model.Duration(node.OriginalOffset))
-	case node.OriginalOffset < time.Duration(0):
+	} else if node.OriginalOffset < time.Duration(0) {
 		offset = fmt.Sprintf(" offset -%s", model.Duration(-node.OriginalOffset))
 	}
 	at := ""
-	switch {
-	case node.Timestamp != nil:
+	if node.Timestamp != nil {
 		at = fmt.Sprintf(" @ %.3f", float64(*node.Timestamp)/1000.0)
-	case node.StartOrEnd == START:
+	} else if node.StartOrEnd == START {
 		at = " @ start()"
-	case node.StartOrEnd == END:
+	} else if node.StartOrEnd == END {
 		at = " @ end()"
 	}
 	return fmt.Sprintf("[%s:%s]%s%s", model.Duration(node.Range), step, at, offset)
@@ -211,19 +207,17 @@ func (node *VectorSelector) String() string {
 		labelStrings = append(labelStrings, matcher.String())
 	}
 	offset := ""
-	switch {
-	case node.OriginalOffset > time.Duration(0):
+	if node.OriginalOffset > time.Duration(0) {
 		offset = fmt.Sprintf(" offset %s", model.Duration(node.OriginalOffset))
-	case node.OriginalOffset < time.Duration(0):
+	} else if node.OriginalOffset < time.Duration(0) {
 		offset = fmt.Sprintf(" offset -%s", model.Duration(-node.OriginalOffset))
 	}
 	at := ""
-	switch {
-	case node.Timestamp != nil:
+	if node.Timestamp != nil {
 		at = fmt.Sprintf(" @ %.3f", float64(*node.Timestamp)/1000.0)
-	case node.StartOrEnd == START:
+	} else if node.StartOrEnd == START {
 		at = " @ start()"
-	case node.StartOrEnd == END:
+	} else if node.StartOrEnd == END {
 		at = " @ end()"
 	}
 
diff --git a/promql/quantile.go b/promql/quantile.go
index 78d0bbaf0..aaead671c 100644
--- a/promql/quantile.go
+++ b/promql/quantile.go
@@ -169,12 +169,11 @@ func histogramQuantile(q float64, h *histogram.FloatHistogram) float64 {
 		}
 	}
 	if bucket.Lower < 0 && bucket.Upper > 0 {
-		switch {
-		case len(h.NegativeBuckets) == 0 && len(h.PositiveBuckets) > 0:
+		if len(h.NegativeBuckets) == 0 && len(h.PositiveBuckets) > 0 {
 			// The result is in the zero bucket and the histogram has only
 			// positive buckets. So we consider 0 to be the lower bound.
 			bucket.Lower = 0
-		case len(h.PositiveBuckets) == 0 && len(h.NegativeBuckets) > 0:
+		} else if len(h.PositiveBuckets) == 0 && len(h.NegativeBuckets) > 0 {
 			// The result is in the zero bucket and the histogram has only
 			// negative buckets. So we consider 0 to be the upper bound.
 			bucket.Upper = 0
@@ -245,13 +244,12 @@ func histogramFraction(lower, upper float64, h *histogram.FloatHistogram) float6
 	for it.Next() {
 		b := it.At()
 		if b.Lower < 0 && b.Upper > 0 {
-			switch {
-			case len(h.NegativeBuckets) == 0 && len(h.PositiveBuckets) > 0:
+			if len(h.NegativeBuckets) == 0 && len(h.PositiveBuckets) > 0 {
 				// This is the zero bucket and the histogram has only
 				// positive buckets. So we consider 0 to be the lower
 				// bound.
 				b.Lower = 0
-			case len(h.PositiveBuckets) == 0 && len(h.NegativeBuckets) > 0:
+			} else if len(h.PositiveBuckets) == 0 && len(h.NegativeBuckets) > 0 {
 				// This is in the zero bucket and the histogram has only
 				// negative buckets. So we consider 0 to be the upper
 				// bound.
diff --git a/rules/manager.go b/rules/manager.go
index 31c90e9e9..07d50be1b 100644
--- a/rules/manager.go
+++ b/rules/manager.go
@@ -189,7 +189,7 @@ type QueryFunc func(ctx context.Context, q string, t time.Time) (promql.Vector,
 // It converts scalar into vector results.
 func EngineQueryFunc(engine *promql.Engine, q storage.Queryable) QueryFunc {
 	return func(ctx context.Context, qs string, t time.Time) (promql.Vector, error) {
-		q, err := engine.NewInstantQuery(ctx, q, nil, qs, t)
+		q, err := engine.NewInstantQuery(q, nil, qs, t)
 		if err != nil {
 			return nil, err
 		}
@@ -866,13 +866,12 @@ func (g *Group) RestoreForState(ts time.Time) {
 			timeSpentPending := downAt.Sub(restoredActiveAt)
 			timeRemainingPending := alertHoldDuration - timeSpentPending
 
-			switch {
-			case timeRemainingPending <= 0:
+			if timeRemainingPending <= 0 {
 				// It means that alert was firing when prometheus went down.
 				// In the next Eval, the state of this alert will be set back to
 				// firing again if it's still firing in that Eval.
 				// Nothing to be done in this case.
-			case timeRemainingPending < g.opts.ForGracePeriod:
+			} else if timeRemainingPending < g.opts.ForGracePeriod {
 				// (new) restoredActiveAt = (ts + m.opts.ForGracePeriod) - alertHoldDuration
 				//                            /* new firing time */      /* moving back by hold duration */
 				//
@@ -885,7 +884,7 @@ func (g *Group) RestoreForState(ts time.Time) {
 				//                        = (ts + m.opts.ForGracePeriod) - ts
 				//                        = m.opts.ForGracePeriod
 				restoredActiveAt = ts.Add(g.opts.ForGracePeriod).Add(-alertHoldDuration)
-			default:
+			} else {
 				// By shifting ActiveAt to the future (ActiveAt + some_duration),
 				// the total pending time from the original ActiveAt
 				// would be `alertHoldDuration + some_duration`.
diff --git a/scrape/manager.go b/scrape/manager.go
index d75fe30cf..69a0eaa1f 100644
--- a/scrape/manager.go
+++ b/scrape/manager.go
@@ -288,11 +288,10 @@ func (m *Manager) ApplyConfig(cfg *config.Config) error {
 	// Cleanup and reload pool if the configuration has changed.
 	var failed bool
 	for name, sp := range m.scrapePools {
-		switch cfg, ok := m.scrapeConfigs[name]; {
-		case !ok:
+		if cfg, ok := m.scrapeConfigs[name]; !ok {
 			sp.stop()
 			delete(m.scrapePools, name)
-		case !reflect.DeepEqual(sp.config, cfg):
+		} else if !reflect.DeepEqual(sp.config, cfg) {
 			err := sp.reload(cfg)
 			if err != nil {
 				level.Error(m.logger).Log("msg", "error reloading scrape pool", "err", err, "scrape_pool", name)
diff --git a/scrape/scrape.go b/scrape/scrape.go
index 680585af8..f38527ff3 100644
--- a/scrape/scrape.go
+++ b/scrape/scrape.go
@@ -503,10 +503,9 @@ func (sp *scrapePool) Sync(tgs []*targetgroup.Group) {
 			// Replicate .Labels().IsEmpty() with a loop here to avoid generating garbage.
 			nonEmpty := false
 			t.LabelsRange(func(l labels.Label) { nonEmpty = true })
-			switch {
-			case nonEmpty:
+			if nonEmpty {
 				all = append(all, t)
-			case !t.discoveredLabels.IsEmpty():
+			} else if !t.discoveredLabels.IsEmpty() {
 				sp.droppedTargets = append(sp.droppedTargets, t)
 			}
 		}
@@ -947,10 +946,9 @@ func (c *scrapeCache) iterDone(flushCache bool) {
 	count := len(c.series) + len(c.droppedSeries) + len(c.metadata)
 	c.metaMtx.Unlock()
 
-	switch {
-	case flushCache:
+	if flushCache {
 		c.successfulCount = count
-	case count > c.successfulCount*2+1000:
+	} else if count > c.successfulCount*2+1000 {
 		// If a target had varying labels in scrapes that ultimately failed,
 		// the caches would grow indefinitely. Force a flush when this happens.
 		// We use the heuristic that this is a doubling of the cache size
diff --git a/storage/fanout.go b/storage/fanout.go
index a9db4f628..4f995afba 100644
--- a/storage/fanout.go
+++ b/storage/fanout.go
@@ -222,10 +222,9 @@ func (f *fanoutAppender) Rollback() (err error) {
 
 	for _, appender := range f.secondaries {
 		rollbackErr := appender.Rollback()
-		switch {
-		case err == nil:
+		if err == nil {
 			err = rollbackErr
-		case rollbackErr != nil:
+		} else if rollbackErr != nil {
 			level.Error(f.logger).Log("msg", "Squashed rollback error on rollback", "err", rollbackErr)
 		}
 	}
diff --git a/storage/interface.go b/storage/interface.go
index b282f1fc6..5cf70a351 100644
--- a/storage/interface.go
+++ b/storage/interface.go
@@ -99,7 +99,7 @@ type MockQueryable struct {
 	MockQuerier Querier
 }
 
-func (q *MockQueryable) Querier(context.Context, int64, int64) (Querier, error) {
+func (q *MockQueryable) Querier(ctx context.Context, mint, maxt int64) (Querier, error) {
 	return q.MockQuerier, nil
 }
 
@@ -118,11 +118,11 @@ type MockQuerier struct {
 	SelectMockFunction func(sortSeries bool, hints *SelectHints, matchers ...*labels.Matcher) SeriesSet
 }
 
-func (q *MockQuerier) LabelValues(string, ...*labels.Matcher) ([]string, Warnings, error) {
+func (q *MockQuerier) LabelValues(name string, matchers ...*labels.Matcher) ([]string, Warnings, error) {
 	return nil, nil, nil
 }
 
-func (q *MockQuerier) LabelNames(...*labels.Matcher) ([]string, Warnings, error) {
+func (q *MockQuerier) LabelNames(matchers ...*labels.Matcher) ([]string, Warnings, error) {
 	return nil, nil, nil
 }
 
diff --git a/storage/merge.go b/storage/merge.go
index c0665d720..8db1f7ae8 100644
--- a/storage/merge.go
+++ b/storage/merge.go
@@ -197,14 +197,13 @@ func mergeStrings(a, b []string) []string {
 	res := make([]string, 0, maxl*10/9)
 
 	for len(a) > 0 && len(b) > 0 {
-		switch {
-		case a[0] == b[0]:
+		if a[0] == b[0] {
 			res = append(res, a[0])
 			a, b = a[1:], b[1:]
-		case a[0] < b[0]:
+		} else if a[0] < b[0] {
 			res = append(res, a[0])
 			a = a[1:]
-		default:
+		} else {
 			res = append(res, b[0])
 			b = b[1:]
 		}
@@ -723,11 +722,12 @@ func (c *compactChunkIterator) Next() bool {
 			break
 		}
 
-		// Only do something if it is not a perfect duplicate.
-		if next.MinTime != prev.MinTime ||
-			next.MaxTime != prev.MaxTime ||
-			!bytes.Equal(next.Chunk.Bytes(), prev.Chunk.Bytes()) {
-			// We operate on same series, so labels do not matter here.
+		if next.MinTime == prev.MinTime &&
+			next.MaxTime == prev.MaxTime &&
+			bytes.Equal(next.Chunk.Bytes(), prev.Chunk.Bytes()) {
+			// 1:1 duplicates, skip it.
+		} else {
+			// We operate on same series, so labels does not matter here.
 			overlapping = append(overlapping, newChunkToSeriesDecoder(labels.EmptyLabels(), next))
 			if next.MaxTime > oMaxTime {
 				oMaxTime = next.MaxTime
diff --git a/storage/remote/codec.go b/storage/remote/codec.go
index 2ceed4de1..bfbd08d24 100644
--- a/storage/remote/codec.go
+++ b/storage/remote/codec.go
@@ -291,14 +291,13 @@ func MergeLabels(primary, secondary []prompb.Label) []prompb.Label {
 	result := make([]prompb.Label, 0, len(primary)+len(secondary))
 	i, j := 0, 0
 	for i < len(primary) && j < len(secondary) {
-		switch {
-		case primary[i].Name < secondary[j].Name:
+		if primary[i].Name < secondary[j].Name {
 			result = append(result, primary[i])
 			i++
-		case primary[i].Name > secondary[j].Name:
+		} else if primary[i].Name > secondary[j].Name {
 			result = append(result, secondary[j])
 			j++
-		default:
+		} else {
 			result = append(result, primary[i])
 			i++
 			j++
@@ -430,8 +429,7 @@ func (c *concreteSeriesIterator) Seek(t int64) chunkenc.ValueType {
 		return c.series.histograms[n+c.histogramsCur].Timestamp >= t
 	})
 
-	switch {
-	case c.floatsCur < len(c.series.floats) && c.histogramsCur < len(c.series.histograms):
+	if c.floatsCur < len(c.series.floats) && c.histogramsCur < len(c.series.histograms) {
 		// If float samples and histogram samples have overlapping timestamps prefer the float samples.
 		if c.series.floats[c.floatsCur].Timestamp <= c.series.histograms[c.histogramsCur].Timestamp {
 			c.curValType = chunkenc.ValFloat
@@ -447,9 +445,9 @@ func (c *concreteSeriesIterator) Seek(t int64) chunkenc.ValueType {
 				c.floatsCur--
 			}
 		}
-	case c.floatsCur < len(c.series.floats):
+	} else if c.floatsCur < len(c.series.floats) {
 		c.curValType = chunkenc.ValFloat
-	case c.histogramsCur < len(c.series.histograms):
+	} else if c.histogramsCur < len(c.series.histograms) {
 		c.curValType = getHistogramValType(&c.series.histograms[c.histogramsCur])
 	}
 
@@ -517,19 +515,18 @@ func (c *concreteSeriesIterator) Next() chunkenc.ValueType {
 	}
 	c.curValType = chunkenc.ValNone
 
-	switch {
-	case peekFloatTS < peekHistTS:
+	if peekFloatTS < peekHistTS {
 		c.floatsCur++
 		c.curValType = chunkenc.ValFloat
-	case peekHistTS < peekFloatTS:
+	} else if peekHistTS < peekFloatTS {
 		c.histogramsCur++
 		c.curValType = chunkenc.ValHistogram
-	case peekFloatTS == noTS && peekHistTS == noTS:
+	} else if peekFloatTS == noTS && peekHistTS == noTS {
 		// This only happens when the iterator is exhausted; we set the cursors off the end to prevent
 		// Seek() from returning anything afterwards.
 		c.floatsCur = len(c.series.floats)
 		c.histogramsCur = len(c.series.histograms)
-	default:
+	} else {
 		// Prefer float samples to histogram samples if there's a conflict. We advance the cursor for histograms
 		// anyway otherwise the histogram sample will get selected on the next call to Next().
 		c.floatsCur++
diff --git a/storage/remote/ewma.go b/storage/remote/ewma.go
index ea4472c49..c7fb0289b 100644
--- a/storage/remote/ewma.go
+++ b/storage/remote/ewma.go
@@ -55,10 +55,9 @@ func (r *ewmaRate) tick() {
 	r.mutex.Lock()
 	defer r.mutex.Unlock()
 
-	switch {
-	case r.init:
+	if r.init {
 		r.lastRate += r.alpha * (instantRate - r.lastRate)
-	case newEvents > 0:
+	} else if newEvents > 0 {
 		r.init = true
 		r.lastRate = instantRate
 	}
diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go
index 10fb6d153..62bd17a66 100644
--- a/storage/remote/queue_manager.go
+++ b/storage/remote/queue_manager.go
@@ -1030,10 +1030,9 @@ func (t *QueueManager) calculateDesiredShards() int {
 		return t.numShards
 	}
 
-	switch {
-	case numShards > t.cfg.MaxShards:
+	if numShards > t.cfg.MaxShards {
 		numShards = t.cfg.MaxShards
-	case numShards < t.cfg.MinShards:
+	} else if numShards < t.cfg.MinShards {
 		numShards = t.cfg.MinShards
 	}
 	return numShards
@@ -1576,11 +1575,10 @@ func sendWriteRequestWithBackoff(ctx context.Context, cfg config.QueueConfig, l
 		}
 
 		sleepDuration = backoff
-		switch {
-		case backoffErr.retryAfter > 0:
+		if backoffErr.retryAfter > 0 {
 			sleepDuration = backoffErr.retryAfter
 			level.Info(l).Log("msg", "Retrying after duration specified by Retry-After header", "duration", sleepDuration)
-		case backoffErr.retryAfter < 0:
+		} else if backoffErr.retryAfter < 0 {
 			level.Debug(l).Log("msg", "retry-after cannot be in past, retrying using default backoff mechanism")
 		}
 
diff --git a/tsdb/agent/db.go b/tsdb/agent/db.go
index 3343ee18e..a17e0d1b9 100644
--- a/tsdb/agent/db.go
+++ b/tsdb/agent/db.go
@@ -732,22 +732,22 @@ func (db *DB) StartTime() (int64, error) {
 }
 
 // Querier implements the Storage interface.
-func (db *DB) Querier(context.Context, int64, int64) (storage.Querier, error) {
+func (db *DB) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error) {
 	return nil, ErrUnsupported
 }
 
 // ChunkQuerier implements the Storage interface.
-func (db *DB) ChunkQuerier(context.Context, int64, int64) (storage.ChunkQuerier, error) {
+func (db *DB) ChunkQuerier(ctx context.Context, mint, maxt int64) (storage.ChunkQuerier, error) {
 	return nil, ErrUnsupported
 }
 
 // ExemplarQuerier implements the Storage interface.
-func (db *DB) ExemplarQuerier(context.Context) (storage.ExemplarQuerier, error) {
+func (db *DB) ExemplarQuerier(ctx context.Context) (storage.ExemplarQuerier, error) {
 	return nil, ErrUnsupported
 }
 
 // Appender implements storage.Storage.
-func (db *DB) Appender(context.Context) storage.Appender {
+func (db *DB) Appender(_ context.Context) storage.Appender {
 	return db.appenderPool.Get().(storage.Appender)
 }
 
@@ -823,7 +823,7 @@ func (a *appender) Append(ref storage.SeriesRef, l labels.Labels, t int64, v flo
 		return 0, storage.ErrOutOfOrderSample
 	}
 
-	// NOTE: always modify pendingSamples and sampleSeries together.
+	// NOTE: always modify pendingSamples and sampleSeries together
 	a.pendingSamples = append(a.pendingSamples, record.RefSample{
 		Ref: series.ref,
 		T:   t,
@@ -849,8 +849,8 @@ func (a *appender) getOrCreate(l labels.Labels) (series *memSeries, created bool
 	return series, true
 }
 
-func (a *appender) AppendExemplar(ref storage.SeriesRef, _ labels.Labels, e exemplar.Exemplar) (storage.SeriesRef, error) {
-	// Series references and chunk references are identical for agent mode.
+func (a *appender) AppendExemplar(ref storage.SeriesRef, l labels.Labels, e exemplar.Exemplar) (storage.SeriesRef, error) {
+	// series references and chunk references are identical for agent mode.
 	headRef := chunks.HeadSeriesRef(ref)
 
 	s := a.series.GetByID(headRef)
@@ -951,8 +951,7 @@ func (a *appender) AppendHistogram(ref storage.SeriesRef, l labels.Labels, t int
 		return 0, storage.ErrOutOfOrderSample
 	}
 
-	switch {
-	case h != nil:
+	if h != nil {
 		// NOTE: always modify pendingHistograms and histogramSeries together
 		a.pendingHistograms = append(a.pendingHistograms, record.RefHistogramSample{
 			Ref: series.ref,
@@ -960,7 +959,7 @@ func (a *appender) AppendHistogram(ref storage.SeriesRef, l labels.Labels, t int
 			H:   h,
 		})
 		a.histogramSeries = append(a.histogramSeries, series)
-	case fh != nil:
+	} else if fh != nil {
 		// NOTE: always modify pendingFloatHistograms and floatHistogramSeries together
 		a.pendingFloatHistograms = append(a.pendingFloatHistograms, record.RefFloatHistogramSample{
 			Ref: series.ref,
@@ -974,7 +973,7 @@ func (a *appender) AppendHistogram(ref storage.SeriesRef, l labels.Labels, t int
 	return storage.SeriesRef(series.ref), nil
 }
 
-func (a *appender) UpdateMetadata(storage.SeriesRef, labels.Labels, metadata.Metadata) (storage.SeriesRef, error) {
+func (a *appender) UpdateMetadata(ref storage.SeriesRef, l labels.Labels, m metadata.Metadata) (storage.SeriesRef, error) {
 	// TODO: Wire metadata in the Agent's appender.
 	return 0, nil
 }
diff --git a/tsdb/chunkenc/float_histogram.go b/tsdb/chunkenc/float_histogram.go
index 67b706b2e..b462c6d9f 100644
--- a/tsdb/chunkenc/float_histogram.go
+++ b/tsdb/chunkenc/float_histogram.go
@@ -107,7 +107,7 @@ func (c *FloatHistogramChunk) Appender() (Appender, error) {
 	// To get an appender, we must know the state it would have if we had
 	// appended all existing data from scratch. We iterate through the end
 	// and populate via the iterator's state.
-	for it.Next() == ValFloatHistogram { // nolint:revive
+	for it.Next() == ValFloatHistogram {
 	}
 	if err := it.Err(); err != nil {
 		return nil, err
diff --git a/tsdb/chunkenc/histogram.go b/tsdb/chunkenc/histogram.go
index 0d53f1f49..7b6a9cacb 100644
--- a/tsdb/chunkenc/histogram.go
+++ b/tsdb/chunkenc/histogram.go
@@ -126,7 +126,7 @@ func (c *HistogramChunk) Appender() (Appender, error) {
 	// To get an appender, we must know the state it would have if we had
 	// appended all existing data from scratch. We iterate through the end
 	// and populate via the iterator's state.
-	for it.Next() == ValHistogram { // nolint:revive
+	for it.Next() == ValHistogram {
 	}
 	if err := it.Err(); err != nil {
 		return nil, err
diff --git a/tsdb/chunkenc/xor.go b/tsdb/chunkenc/xor.go
index 133ed9952..2fa2f613c 100644
--- a/tsdb/chunkenc/xor.go
+++ b/tsdb/chunkenc/xor.go
@@ -99,7 +99,7 @@ func (c *XORChunk) Appender() (Appender, error) {
 	// To get an appender we must know the state it would have if we had
 	// appended all existing data from scratch.
 	// We iterate through the end and populate via the iterator's state.
-	for it.Next() != ValNone { // nolint:revive
+	for it.Next() != ValNone {
 	}
 	if err := it.Err(); err != nil {
 		return nil, err
@@ -152,11 +152,11 @@ type xorAppender struct {
 	trailing uint8
 }
 
-func (a *xorAppender) AppendHistogram(int64, *histogram.Histogram) {
+func (a *xorAppender) AppendHistogram(t int64, h *histogram.Histogram) {
 	panic("appended a histogram to an xor chunk")
 }
 
-func (a *xorAppender) AppendFloatHistogram(int64, *histogram.FloatHistogram) {
+func (a *xorAppender) AppendFloatHistogram(t int64, h *histogram.FloatHistogram) {
 	panic("appended a float histogram to an xor chunk")
 }
 
@@ -164,15 +164,14 @@ func (a *xorAppender) Append(t int64, v float64) {
 	var tDelta uint64
 	num := binary.BigEndian.Uint16(a.b.bytes())
 
-	switch num {
-	case 0:
+	if num == 0 {
 		buf := make([]byte, binary.MaxVarintLen64)
 		for _, b := range buf[:binary.PutVarint(buf, t)] {
 			a.b.writeByte(b)
 		}
 		a.b.writeBits(math.Float64bits(v), 64)
 
-	case 1:
+	} else if num == 1 {
 		tDelta = uint64(t - a.t)
 
 		buf := make([]byte, binary.MaxVarintLen64)
@@ -182,7 +181,7 @@ func (a *xorAppender) Append(t int64, v float64) {
 
 		a.writeVDelta(v)
 
-	default:
+	} else {
 		tDelta = uint64(t - a.t)
 		dod := int64(tDelta - a.tDelta)
 
diff --git a/tsdb/chunks/head_chunks.go b/tsdb/chunks/head_chunks.go
index bcdab2125..a7ff90475 100644
--- a/tsdb/chunks/head_chunks.go
+++ b/tsdb/chunks/head_chunks.go
@@ -999,10 +999,9 @@ func (cdm *ChunkDiskMapper) DeleteCorrupted(originalErr error) error {
 	cdm.readPathMtx.RLock()
 	lastSeq := 0
 	for seg := range cdm.mmappedChunkFiles {
-		switch {
-		case seg >= cerr.FileIndex:
+		if seg >= cerr.FileIndex {
 			segs = append(segs, seg)
-		case seg > lastSeq:
+		} else if seg > lastSeq {
 			lastSeq = seg
 		}
 	}
diff --git a/tsdb/db.go b/tsdb/db.go
index 45c0771b1..659251c3c 100644
--- a/tsdb/db.go
+++ b/tsdb/db.go
@@ -963,11 +963,10 @@ func (db *DB) ApplyConfig(conf *config.Config) error {
 	// Create WBL if it was not present and if OOO is enabled with WAL enabled.
 	var wblog *wlog.WL
 	var err error
-	switch {
-	case db.head.wbl != nil:
+	if db.head.wbl != nil {
 		// The existing WBL from the disk might have been replayed while OOO was disabled.
 		wblog = db.head.wbl
-	case !db.oooWasEnabled.Load() && oooTimeWindow > 0 && db.opts.WALSegmentSize >= 0:
+	} else if !db.oooWasEnabled.Load() && oooTimeWindow > 0 && db.opts.WALSegmentSize >= 0 {
 		segmentSize := wlog.DefaultSegmentSize
 		// Wal is set to a custom size.
 		if db.opts.WALSegmentSize > 0 {
@@ -1533,11 +1532,10 @@ func (db *DB) deleteBlocks(blocks map[ulid.ULID]*Block) error {
 		}
 
 		toDelete := filepath.Join(db.dir, ulid.String())
-		switch _, err := os.Stat(toDelete); {
-		case os.IsNotExist(err):
+		if _, err := os.Stat(toDelete); os.IsNotExist(err) {
 			// Noop.
 			continue
-		case err != nil:
+		} else if err != nil {
 			return errors.Wrapf(err, "stat dir %v", toDelete)
 		}
 
diff --git a/tsdb/exemplar.go b/tsdb/exemplar.go
index ca108ae91..5ba3567e4 100644
--- a/tsdb/exemplar.go
+++ b/tsdb/exemplar.go
@@ -115,17 +115,17 @@ func NewExemplarMetrics(reg prometheus.Registerer) *ExemplarMetrics {
 // 1GB of extra memory, accounting for the fact that this is heap allocated space.
 // If len <= 0, then the exemplar storage is essentially a noop storage but can later be
 // resized to store exemplars.
-func NewCircularExemplarStorage(length int64, m *ExemplarMetrics) (ExemplarStorage, error) {
-	if length < 0 {
-		length = 0
+func NewCircularExemplarStorage(len int64, m *ExemplarMetrics) (ExemplarStorage, error) {
+	if len < 0 {
+		len = 0
 	}
 	c := &CircularExemplarStorage{
-		exemplars: make([]*circularBufferEntry, length),
-		index:     make(map[string]*indexEntry, length/estimatedExemplarsPerSeries),
+		exemplars: make([]*circularBufferEntry, len),
+		index:     make(map[string]*indexEntry, len/estimatedExemplarsPerSeries),
 		metrics:   m,
 	}
 
-	c.metrics.maxExemplars.Set(float64(length))
+	c.metrics.maxExemplars.Set(float64(len))
 
 	return c, nil
 }
diff --git a/tsdb/head.go b/tsdb/head.go
index 1d65d3229..4696884f2 100644
--- a/tsdb/head.go
+++ b/tsdb/head.go
@@ -574,7 +574,7 @@ const cardinalityCacheExpirationTime = time.Duration(30) * time.Second
 func (h *Head) Init(minValidTime int64) error {
 	h.minValidTime.Store(minValidTime)
 	defer func() {
-		h.postings.EnsureOrder(h.opts.WALReplayConcurrency)
+		h.postings.EnsureOrder()
 	}()
 	defer h.gc() // After loading the wal remove the obsolete data from the head.
 	defer func() {
diff --git a/tsdb/head_append.go b/tsdb/head_append.go
index 86cb09751..6bc91ae06 100644
--- a/tsdb/head_append.go
+++ b/tsdb/head_append.go
@@ -344,10 +344,9 @@ func (a *headAppender) Append(ref storage.SeriesRef, lset labels.Labels, t int64
 	}
 
 	if value.IsStaleNaN(v) {
-		switch {
-		case s.lastHistogramValue != nil:
+		if s.lastHistogramValue != nil {
 			return a.AppendHistogram(ref, lset, t, &histogram.Histogram{Sum: v}, nil)
-		case s.lastFloatHistogramValue != nil:
+		} else if s.lastFloatHistogramValue != nil {
 			return a.AppendHistogram(ref, lset, t, nil, &histogram.FloatHistogram{Sum: v})
 		}
 	}
@@ -553,10 +552,9 @@ func (a *headAppender) AppendHistogram(ref storage.SeriesRef, lset labels.Labels
 			return 0, err
 		}
 		if created {
-			switch {
-			case h != nil:
+			if h != nil {
 				s.lastHistogramValue = &histogram.Histogram{}
-			case fh != nil:
+			} else if fh != nil {
 				s.lastFloatHistogramValue = &histogram.FloatHistogram{}
 			}
 			a.series = append(a.series, record.RefSeries{
@@ -566,8 +564,7 @@ func (a *headAppender) AppendHistogram(ref storage.SeriesRef, lset labels.Labels
 		}
 	}
 
-	switch {
-	case h != nil:
+	if h != nil {
 		s.Lock()
 		if err := s.appendableHistogram(t, h); err != nil {
 			s.Unlock()
@@ -584,7 +581,7 @@ func (a *headAppender) AppendHistogram(ref storage.SeriesRef, lset labels.Labels
 			H:   h,
 		})
 		a.histogramSeries = append(a.histogramSeries, s)
-	case fh != nil:
+	} else if fh != nil {
 		s.Lock()
 		if err := s.appendableFloatHistogram(t, fh); err != nil {
 			s.Unlock()
@@ -941,10 +938,7 @@ func (a *headAppender) Commit() (err error) {
 
 		var ok, chunkCreated bool
 
-		switch {
-		case err != nil:
-			// Do nothing here.
-		case oooSample:
+		if err == nil && oooSample {
 			// Sample is OOO and OOO handling is enabled
 			// and the delta is within the OOO tolerance.
 			var mmapRef chunks.ChunkDiskMapperRef
@@ -982,7 +976,7 @@ func (a *headAppender) Commit() (err error) {
 				// TODO(codesome): Add error reporting? It depends on addressing https://github.com/prometheus/prometheus/discussions/10305.
 				samplesAppended--
 			}
-		default:
+		} else if err == nil {
 			ok, chunkCreated = series.append(s.T, s.V, a.appendID, a.head.chunkDiskMapper, chunkRange)
 			if ok {
 				if s.T < inOrderMint {
@@ -1183,15 +1177,14 @@ func (s *memSeries) appendHistogram(t int64, h *histogram.Histogram, appendID ui
 			app.RecodeHistogram(h, pBackwardInserts, nBackwardInserts)
 		}
 		// We have 3 cases here
-		// - !okToAppend or counterReset -> We need to cut a new chunk.
+		// - !okToAppend -> We need to cut a new chunk.
 		// - okToAppend but we have inserts → Existing chunk needs
 		//   recoding before we can append our histogram.
 		// - okToAppend and no inserts → Chunk is ready to support our histogram.
-		switch {
-		case !okToAppend || counterReset:
+		if !okToAppend || counterReset {
 			c = s.cutNewHeadChunk(t, chunkenc.EncHistogram, chunkDiskMapper, chunkRange)
 			chunkCreated = true
-		case len(pForwardInserts) > 0 || len(nForwardInserts) > 0:
+		} else if len(pForwardInserts) > 0 || len(nForwardInserts) > 0 {
 			// New buckets have appeared. We need to recode all
 			// prior histogram samples within the chunk before we
 			// can process this one.
@@ -1277,15 +1270,14 @@ func (s *memSeries) appendFloatHistogram(t int64, fh *histogram.FloatHistogram,
 			app.RecodeHistogramm(fh, pBackwardInserts, nBackwardInserts)
 		}
 		// We have 3 cases here
-		// - !okToAppend or counterReset -> We need to cut a new chunk.
+		// - !okToAppend -> We need to cut a new chunk.
 		// - okToAppend but we have inserts → Existing chunk needs
 		//   recoding before we can append our histogram.
 		// - okToAppend and no inserts → Chunk is ready to support our histogram.
-		switch {
-		case !okToAppend || counterReset:
+		if !okToAppend || counterReset {
 			c = s.cutNewHeadChunk(t, chunkenc.EncFloatHistogram, chunkDiskMapper, chunkRange)
 			chunkCreated = true
-		case len(pForwardInserts) > 0 || len(nForwardInserts) > 0:
+		} else if len(pForwardInserts) > 0 || len(nForwardInserts) > 0 {
 			// New buckets have appeared. We need to recode all
 			// prior histogram samples within the chunk before we
 			// can process this one.
diff --git a/tsdb/head_read.go b/tsdb/head_read.go
index 9c546ab16..9c40bcd7a 100644
--- a/tsdb/head_read.go
+++ b/tsdb/head_read.go
@@ -424,8 +424,7 @@ func (s *memSeries) oooMergedChunk(meta chunks.Meta, cdm *chunks.ChunkDiskMapper
 			break
 		}
 
-		switch {
-		case chunkRef == meta.OOOLastRef:
+		if chunkRef == meta.OOOLastRef {
 			tmpChks = append(tmpChks, chunkMetaAndChunkDiskMapperRef{
 				meta: chunks.Meta{
 					MinTime: meta.OOOLastMinTime,
@@ -436,7 +435,7 @@ func (s *memSeries) oooMergedChunk(meta chunks.Meta, cdm *chunks.ChunkDiskMapper
 				origMinT: c.minTime,
 				origMaxT: c.maxTime,
 			})
-		case c.OverlapsClosedInterval(mint, maxt):
+		} else if c.OverlapsClosedInterval(mint, maxt) {
 			tmpChks = append(tmpChks, chunkMetaAndChunkDiskMapperRef{
 				meta: chunks.Meta{
 					MinTime: c.minTime,
@@ -595,14 +594,12 @@ type boundedIterator struct {
 func (b boundedIterator) Next() chunkenc.ValueType {
 	for b.Iterator.Next() == chunkenc.ValFloat {
 		t, _ := b.Iterator.At()
-		switch {
-		case t < b.minT:
+		if t < b.minT {
 			continue
-		case t > b.maxT:
+		} else if t > b.maxT {
 			return chunkenc.ValNone
-		default:
-			return chunkenc.ValFloat
 		}
+		return chunkenc.ValFloat
 	}
 	return chunkenc.ValNone
 }
diff --git a/tsdb/head_wal.go b/tsdb/head_wal.go
index 4da500a71..6a8a30d5a 100644
--- a/tsdb/head_wal.go
+++ b/tsdb/head_wal.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many legitimately empty blocks in this file.
 package tsdb
 
 import (
diff --git a/tsdb/index/postings.go b/tsdb/index/postings.go
index 514775210..b55d70df0 100644
--- a/tsdb/index/postings.go
+++ b/tsdb/index/postings.go
@@ -224,10 +224,7 @@ func (p *MemPostings) All() Postings {
 
 // EnsureOrder ensures that all postings lists are sorted. After it returns all further
 // calls to add and addFor will insert new IDs in a sorted manner.
-// Parameter numberOfConcurrentProcesses is used to specify the maximal number of
-// CPU cores used for this operation. If it is <= 0, GOMAXPROCS is used.
-// GOMAXPROCS was the default before introducing this parameter.
-func (p *MemPostings) EnsureOrder(numberOfConcurrentProcesses int) {
+func (p *MemPostings) EnsureOrder() {
 	p.mtx.Lock()
 	defer p.mtx.Unlock()
 
@@ -235,16 +232,13 @@ func (p *MemPostings) EnsureOrder(numberOfConcurrentProcesses int) {
 		return
 	}
 
-	concurrency := numberOfConcurrentProcesses
-	if concurrency <= 0 {
-		concurrency = runtime.GOMAXPROCS(0)
-	}
+	n := runtime.GOMAXPROCS(0)
 	workc := make(chan *[][]storage.SeriesRef)
 
 	var wg sync.WaitGroup
-	wg.Add(concurrency)
+	wg.Add(n)
 
-	for i := 0; i < concurrency; i++ {
+	for i := 0; i < n; i++ {
 		go func() {
 			for job := range workc {
 				for _, l := range *job {
@@ -565,11 +559,12 @@ func newMergedPostings(p []Postings) (m *mergedPostings, nonEmpty bool) {
 
 	for _, it := range p {
 		// NOTE: mergedPostings struct requires the user to issue an initial Next.
-		switch {
-		case it.Next():
+		if it.Next() {
 			ph = append(ph, it)
-		case it.Err() != nil:
-			return &mergedPostings{err: it.Err()}, true
+		} else {
+			if it.Err() != nil {
+				return &mergedPostings{err: it.Err()}, true
+			}
 		}
 	}
 
@@ -703,16 +698,16 @@ func (rp *removedPostings) Next() bool {
 			return true
 		}
 
-		switch fcur, rcur := rp.full.At(), rp.remove.At(); {
-		case fcur < rcur:
+		fcur, rcur := rp.full.At(), rp.remove.At()
+		if fcur < rcur {
 			rp.cur = fcur
 			rp.fok = rp.full.Next()
 
 			return true
-		case rcur < fcur:
+		} else if rcur < fcur {
 			// Forward the remove postings to the right position.
 			rp.rok = rp.remove.Seek(fcur)
-		default:
+		} else {
 			// Skip the current posting.
 			rp.fok = rp.full.Next()
 		}
@@ -847,10 +842,9 @@ func (it *bigEndianPostings) Err() error {
 func FindIntersectingPostings(p Postings, candidates []Postings) (indexes []int, err error) {
 	h := make(postingsWithIndexHeap, 0, len(candidates))
 	for idx, it := range candidates {
-		switch {
-		case it.Next():
+		if it.Next() {
 			h = append(h, postingsWithIndex{index: idx, p: it})
-		case it.Err() != nil:
+		} else if it.Err() != nil {
 			return nil, it.Err()
 		}
 	}
diff --git a/tsdb/ooo_head_read.go b/tsdb/ooo_head_read.go
index 8ba3ea39a..86d0e3b7b 100644
--- a/tsdb/ooo_head_read.go
+++ b/tsdb/ooo_head_read.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many unsued function arguments in this file by design.
 package tsdb
 
 import (
@@ -123,7 +122,7 @@ func (oh *OOOHeadIndexReader) series(ref storage.SeriesRef, builder *labels.Scra
 		}
 	}
 
-	// There is nothing to do if we did not collect any chunk.
+	// There is nothing to do if we did not collect any chunk
 	if len(tmpChks) == 0 {
 		return nil
 	}
@@ -136,15 +135,14 @@ func (oh *OOOHeadIndexReader) series(ref storage.SeriesRef, builder *labels.Scra
 	// chunks Meta the first chunk that overlaps with others.
 	// Example chunks of a series: 5:(100, 200) 6:(500, 600) 7:(150, 250) 8:(550, 650)
 	// In the example 5 overlaps with 7 and 6 overlaps with 8 so we only want to
-	// to return chunk Metas for chunk 5 and chunk 6e
+	// to return chunk Metas for chunk 5 and chunk 6
 	*chks = append(*chks, tmpChks[0])
-	maxTime := tmpChks[0].MaxTime // Tracks the maxTime of the previous "to be merged chunk".
+	maxTime := tmpChks[0].MaxTime // tracks the maxTime of the previous "to be merged chunk"
 	for _, c := range tmpChks[1:] {
-		switch {
-		case c.MinTime > maxTime:
+		if c.MinTime > maxTime {
 			*chks = append(*chks, c)
 			maxTime = c.MaxTime
-		case c.MaxTime > maxTime:
+		} else if c.MaxTime > maxTime {
 			maxTime = c.MaxTime
 			(*chks)[len(*chks)-1].MaxTime = c.MaxTime
 		}
diff --git a/tsdb/querier.go b/tsdb/querier.go
index abddebb87..4b3144c71 100644
--- a/tsdb/querier.go
+++ b/tsdb/querier.go
@@ -239,20 +239,18 @@ func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (index.Postings,
 	}
 
 	for _, m := range ms {
-		switch {
-		case m.Name == "" && m.Value == "": // Special-case for AllPostings, used in tests at least.
+		if m.Name == "" && m.Value == "" { // Special-case for AllPostings, used in tests at least.
 			k, v := index.AllPostingsKey()
 			allPostings, err := ix.Postings(k, v)
 			if err != nil {
 				return nil, err
 			}
 			its = append(its, allPostings)
-		case labelMustBeSet[m.Name]:
+		} else if labelMustBeSet[m.Name] {
 			// If this matcher must be non-empty, we can be smarter.
 			matchesEmpty := m.Matches("")
 			isNot := m.Type == labels.MatchNotEqual || m.Type == labels.MatchNotRegexp
-			switch {
-			case isNot && matchesEmpty: // l!="foo"
+			if isNot && matchesEmpty { // l!="foo"
 				// If the label can't be empty and is a Not and the inner matcher
 				// doesn't match empty, then subtract it out at the end.
 				inverse, err := m.Inverse()
@@ -265,7 +263,7 @@ func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (index.Postings,
 					return nil, err
 				}
 				notIts = append(notIts, it)
-			case isNot && !matchesEmpty: // l!=""
+			} else if isNot && !matchesEmpty { // l!=""
 				// If the label can't be empty and is a Not, but the inner matcher can
 				// be empty we need to use inversePostingsForMatcher.
 				inverse, err := m.Inverse()
@@ -281,7 +279,7 @@ func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (index.Postings,
 					return index.EmptyPostings(), nil
 				}
 				its = append(its, it)
-			default: // l="a"
+			} else { // l="a"
 				// Non-Not matcher, use normal postingsForMatcher.
 				it, err := postingsForMatcher(ix, m)
 				if err != nil {
@@ -292,7 +290,7 @@ func PostingsForMatchers(ix IndexReader, ms ...*labels.Matcher) (index.Postings,
 				}
 				its = append(its, it)
 			}
-		default: // l=""
+		} else { // l=""
 			// If the matchers for a labelname selects an empty value, it selects all
 			// the series which don't have the label name set too. See:
 			// https://github.com/prometheus/prometheus/issues/3575 and
@@ -968,24 +966,23 @@ func (m *mergedStringIter) Next() bool {
 		return false
 	}
 
-	switch {
-	case !m.aok:
+	if !m.aok {
 		m.cur = m.b.At()
 		m.bok = m.b.Next()
 		m.err = m.b.Err()
-	case !m.bok:
+	} else if !m.bok {
 		m.cur = m.a.At()
 		m.aok = m.a.Next()
 		m.err = m.a.Err()
-	case m.b.At() > m.a.At():
+	} else if m.b.At() > m.a.At() {
 		m.cur = m.a.At()
 		m.aok = m.a.Next()
 		m.err = m.a.Err()
-	case m.a.At() > m.b.At():
+	} else if m.a.At() > m.b.At() {
 		m.cur = m.b.At()
 		m.bok = m.b.Next()
 		m.err = m.b.Err()
-	default: // Equal.
+	} else { // Equal.
 		m.cur = m.b.At()
 		m.aok = m.a.Next()
 		m.err = m.a.Err()
@@ -1088,7 +1085,7 @@ func newNopChunkReader() ChunkReader {
 	}
 }
 
-func (cr nopChunkReader) Chunk(chunks.Meta) (chunkenc.Chunk, error) {
+func (cr nopChunkReader) Chunk(meta chunks.Meta) (chunkenc.Chunk, error) {
 	return cr.emptyChunk, nil
 }
 
diff --git a/tsdb/tombstones/tombstones.go b/tsdb/tombstones/tombstones.go
index a52e1caa9..f7e2a2a1e 100644
--- a/tsdb/tombstones/tombstones.go
+++ b/tsdb/tombstones/tombstones.go
@@ -190,10 +190,9 @@ type Stone struct {
 
 func ReadTombstones(dir string) (Reader, int64, error) {
 	b, err := os.ReadFile(filepath.Join(dir, TombstonesFilename))
-	switch {
-	case os.IsNotExist(err):
+	if os.IsNotExist(err) {
 		return NewMemTombstones(), 0, nil
-	case err != nil:
+	} else if err != nil {
 		return nil, 0, err
 	}
 
diff --git a/tsdb/wal.go b/tsdb/wal.go
index 0c57865e6..e0bc1ec69 100644
--- a/tsdb/wal.go
+++ b/tsdb/wal.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many unsued function arguments in this file by design.
 package tsdb
 
 import (
@@ -522,10 +521,9 @@ func (w *SegmentWAL) openSegmentFile(name string) (*os.File, error) {
 		}
 	}()
 
-	switch n, err := f.Read(metab); {
-	case err != nil:
+	if n, err := f.Read(metab); err != nil {
 		return nil, errors.Wrapf(err, "validate meta %q", f.Name())
-	case n != 8:
+	} else if n != 8 {
 		return nil, errors.Errorf("invalid header size %d in %q", n, f.Name())
 	}
 
@@ -1064,10 +1062,9 @@ func (r *walReader) entry(cr io.Reader) (WALEntryType, byte, []byte, error) {
 	tr := io.TeeReader(cr, r.crc32)
 
 	b := make([]byte, 6)
-	switch n, err := tr.Read(b); {
-	case err != nil:
+	if n, err := tr.Read(b); err != nil {
 		return 0, 0, nil, err
-	case n != 6:
+	} else if n != 6 {
 		return 0, 0, nil, r.corruptionErr("invalid entry header size %d", n)
 	}
 
@@ -1089,17 +1086,15 @@ func (r *walReader) entry(cr io.Reader) (WALEntryType, byte, []byte, error) {
 	}
 	buf := r.buf[:length]
 
-	switch n, err := tr.Read(buf); {
-	case err != nil:
+	if n, err := tr.Read(buf); err != nil {
 		return 0, 0, nil, err
-	case n != length:
+	} else if n != length {
 		return 0, 0, nil, r.corruptionErr("invalid entry body size %d", n)
 	}
 
-	switch n, err := cr.Read(b[:4]); {
-	case err != nil:
+	if n, err := cr.Read(b[:4]); err != nil {
 		return 0, 0, nil, err
-	case n != 4:
+	} else if n != 4 {
 		return 0, 0, nil, r.corruptionErr("invalid checksum length %d", n)
 	}
 	if exp, has := binary.BigEndian.Uint32(b[:4]), r.crc32.Sum32(); has != exp {
diff --git a/tsdb/wlog/live_reader.go b/tsdb/wlog/live_reader.go
index 0ca69093a..29467aef4 100644
--- a/tsdb/wlog/live_reader.go
+++ b/tsdb/wlog/live_reader.go
@@ -126,10 +126,9 @@ func (r *LiveReader) Next() bool {
 		// we return  EOF and the user can try again later. If we have a full
 		// page, buildRecord is guaranteed to return a record or a non-EOF; it
 		// has checks the records fit in pages.
-		switch ok, err := r.buildRecord(); {
-		case ok:
+		if ok, err := r.buildRecord(); ok {
 			return true
-		case err != nil && err != io.EOF:
+		} else if err != nil && err != io.EOF {
 			r.err = err
 			return false
 		}
diff --git a/tsdb/wlog/watcher.go b/tsdb/wlog/watcher.go
index b0c17dcba..72121283d 100644
--- a/tsdb/wlog/watcher.go
+++ b/tsdb/wlog/watcher.go
@@ -405,10 +405,9 @@ func (w *Watcher) watch(segmentNum int, tail bool) error {
 
 			// Ignore errors reading to end of segment whilst replaying the WAL.
 			if !tail {
-				switch {
-				case err != nil && errors.Cause(err) != io.EOF:
+				if err != nil && errors.Cause(err) != io.EOF {
 					level.Warn(w.logger).Log("msg", "Ignoring error reading to end of segment, may have dropped data", "err", err)
-				case reader.Offset() != size:
+				} else if reader.Offset() != size {
 					level.Warn(w.logger).Log("msg", "Expected to have read whole segment, may have dropped data", "segment", segmentNum, "read", reader.Offset(), "size", size)
 				}
 				return nil
@@ -426,10 +425,9 @@ func (w *Watcher) watch(segmentNum int, tail bool) error {
 
 			// Ignore all errors reading to end of segment whilst replaying the WAL.
 			if !tail {
-				switch {
-				case err != nil && errors.Cause(err) != io.EOF:
+				if err != nil && errors.Cause(err) != io.EOF {
 					level.Warn(w.logger).Log("msg", "Ignoring error reading to end of segment, may have dropped data", "segment", segmentNum, "err", err)
-				case reader.Offset() != size:
+				} else if reader.Offset() != size {
 					level.Warn(w.logger).Log("msg", "Expected to have read whole segment, may have dropped data", "segment", segmentNum, "read", reader.Offset(), "size", size)
 				}
 				return nil
diff --git a/util/treecache/treecache.go b/util/treecache/treecache.go
index bece9d5c8..7dd41dced 100644
--- a/util/treecache/treecache.go
+++ b/util/treecache/treecache.go
@@ -116,7 +116,7 @@ func (tc *ZookeeperTreeCache) Stop() {
 	tc.stop <- struct{}{}
 	go func() {
 		// Drain tc.head.events so that go routines can make progress and exit.
-		for range tc.head.events { // nolint:revive
+		for range tc.head.events {
 		}
 	}()
 	go func() {
@@ -176,11 +176,11 @@ func (tc *ZookeeperTreeCache) loop(path string) {
 					node = childNode
 				}
 
-				switch err := tc.recursiveNodeUpdate(ev.Path, node); {
-				case err != nil:
+				err := tc.recursiveNodeUpdate(ev.Path, node)
+				if err != nil {
 					level.Error(tc.logger).Log("msg", "Error during processing of Zookeeper event", "err", err)
 					failure()
-				case tc.head.data == nil:
+				} else if tc.head.data == nil {
 					level.Error(tc.logger).Log("msg", "Error during processing of Zookeeper event", "err", "path no longer exists", "path", tc.prefix)
 					failure()
 				}
@@ -214,14 +214,13 @@ func (tc *ZookeeperTreeCache) loop(path string) {
 
 func (tc *ZookeeperTreeCache) recursiveNodeUpdate(path string, node *zookeeperTreeCacheNode) error {
 	data, _, dataWatcher, err := tc.conn.GetW(path)
-	switch {
-	case errors.Is(err, zk.ErrNoNode):
+	if errors.Is(err, zk.ErrNoNode) {
 		tc.recursiveDelete(path, node)
 		if node == tc.head {
 			return fmt.Errorf("path %s does not exist", path)
 		}
 		return nil
-	case err != nil:
+	} else if err != nil {
 		return err
 	}
 
@@ -231,11 +230,10 @@ func (tc *ZookeeperTreeCache) recursiveNodeUpdate(path string, node *zookeeperTr
 	}
 
 	children, _, childWatcher, err := tc.conn.ChildrenW(path)
-	switch {
-	case errors.Is(err, zk.ErrNoNode):
+	if errors.Is(err, zk.ErrNoNode) {
 		tc.recursiveDelete(path, node)
 		return nil
-	case err != nil:
+	} else if err != nil {
 		return err
 	}
 
diff --git a/web/api/v1/api.go b/web/api/v1/api.go
index f4d6d27da..aeea87ca7 100644
--- a/web/api/v1/api.go
+++ b/web/api/v1/api.go
@@ -117,7 +117,7 @@ type RulesRetriever interface {
 
 type StatsRenderer func(context.Context, *stats.Statistics, string) stats.QueryStats
 
-func defaultStatsRenderer(_ context.Context, s *stats.Statistics, param string) stats.QueryStats {
+func defaultStatsRenderer(ctx context.Context, s *stats.Statistics, param string) stats.QueryStats {
 	if param != "" {
 		return stats.NewQueryStats(s)
 	}
@@ -177,8 +177,8 @@ type TSDBAdminStats interface {
 // QueryEngine defines the interface for the *promql.Engine, so it can be replaced, wrapped or mocked.
 type QueryEngine interface {
 	SetQueryLogger(l promql.QueryLogger)
-	NewInstantQuery(ctx context.Context, q storage.Queryable, opts *promql.QueryOpts, qs string, ts time.Time) (promql.Query, error)
-	NewRangeQuery(ctx context.Context, q storage.Queryable, opts *promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error)
+	NewInstantQuery(q storage.Queryable, opts *promql.QueryOpts, qs string, ts time.Time) (promql.Query, error)
+	NewRangeQuery(q storage.Queryable, opts *promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error)
 }
 
 // API can register a set of endpoints in a router and handle
@@ -392,7 +392,7 @@ func invalidParamError(err error, parameter string) apiFuncResult {
 	}, nil, nil}
 }
 
-func (api *API) options(*http.Request) apiFuncResult {
+func (api *API) options(r *http.Request) apiFuncResult {
 	return apiFuncResult{nil, nil, nil, nil}
 }
 
@@ -417,7 +417,7 @@ func (api *API) query(r *http.Request) (result apiFuncResult) {
 	if err != nil {
 		return apiFuncResult{nil, &apiError{errorBadData, err}, nil, nil}
 	}
-	qry, err := api.QueryEngine.NewInstantQuery(ctx, api.Queryable, opts, r.FormValue("query"), ts)
+	qry, err := api.QueryEngine.NewInstantQuery(api.Queryable, opts, r.FormValue("query"), ts)
 	if err != nil {
 		return invalidParamError(err, "query")
 	}
@@ -520,7 +520,7 @@ func (api *API) queryRange(r *http.Request) (result apiFuncResult) {
 	if err != nil {
 		return apiFuncResult{nil, &apiError{errorBadData, err}, nil, nil}
 	}
-	qry, err := api.QueryEngine.NewRangeQuery(ctx, api.Queryable, opts, r.FormValue("query"), start, end, step)
+	qry, err := api.QueryEngine.NewRangeQuery(api.Queryable, opts, r.FormValue("query"), start, end, step)
 	if err != nil {
 		return apiFuncResult{nil, &apiError{errorBadData, err}, nil, nil}
 	}
@@ -989,14 +989,12 @@ func (api *API) targets(r *http.Request) apiFuncResult {
 					ScrapeURL:        target.URL().String(),
 					GlobalURL:        globalURL.String(),
 					LastError: func() string {
-						switch {
-						case err == nil && lastErrStr == "":
+						if err == nil && lastErrStr == "" {
 							return ""
-						case err != nil:
+						} else if err != nil {
 							return errors.Wrapf(err, lastErrStr).Error()
-						default:
-							return lastErrStr
 						}
+						return lastErrStr
 					}(),
 					LastScrape:         target.LastScrape(),
 					LastScrapeDuration: target.LastScrapeDuration().Seconds(),
@@ -1567,7 +1565,7 @@ func (api *API) snapshot(r *http.Request) apiFuncResult {
 	}{name}, nil, nil, nil}
 }
 
-func (api *API) cleanTombstones(*http.Request) apiFuncResult {
+func (api *API) cleanTombstones(r *http.Request) apiFuncResult {
 	if !api.enableAdmin {
 		return apiFuncResult{nil, &apiError{errorUnavailable, errors.New("admin APIs disabled")}, nil, nil}
 	}
@@ -1766,7 +1764,7 @@ func marshalSeriesJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
 	stream.WriteObjectEnd()
 }
 
-func marshalSeriesJSONIsEmpty(unsafe.Pointer) bool {
+func marshalSeriesJSONIsEmpty(ptr unsafe.Pointer) bool {
 	return false
 }
 
@@ -1819,7 +1817,7 @@ func marshalSampleJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
 	stream.WriteObjectEnd()
 }
 
-func marshalSampleJSONIsEmpty(unsafe.Pointer) bool {
+func marshalSampleJSONIsEmpty(ptr unsafe.Pointer) bool {
 	return false
 }
 
@@ -1843,7 +1841,7 @@ func marshalHPointJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
 	stream.WriteArrayEnd()
 }
 
-func marshalPointJSONIsEmpty(unsafe.Pointer) bool {
+func marshalPointJSONIsEmpty(ptr unsafe.Pointer) bool {
 	return false
 }
 
@@ -1880,6 +1878,6 @@ func marshalExemplarJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
 	stream.WriteObjectEnd()
 }
 
-func marshalExemplarJSONEmpty(unsafe.Pointer) bool {
+func marshalExemplarJSONEmpty(ptr unsafe.Pointer) bool {
 	return false
 }
diff --git a/web/web.go b/web/web.go
index cac41502d..9d63094f6 100644
--- a/web/web.go
+++ b/web/web.go
@@ -755,14 +755,14 @@ func toFloat64(f *io_prometheus_client.MetricFamily) float64 {
 	return math.NaN()
 }
 
-func (h *Handler) version(w http.ResponseWriter, _ *http.Request) {
+func (h *Handler) version(w http.ResponseWriter, r *http.Request) {
 	dec := json.NewEncoder(w)
 	if err := dec.Encode(h.versionInfo); err != nil {
 		http.Error(w, fmt.Sprintf("error encoding JSON: %s", err), http.StatusInternalServerError)
 	}
 }
 
-func (h *Handler) quit(w http.ResponseWriter, _ *http.Request) {
+func (h *Handler) quit(w http.ResponseWriter, r *http.Request) {
 	var closed bool
 	h.quitOnce.Do(func() {
 		closed = true
@@ -774,7 +774,7 @@ func (h *Handler) quit(w http.ResponseWriter, _ *http.Request) {
 	}
 }
 
-func (h *Handler) reload(w http.ResponseWriter, _ *http.Request) {
+func (h *Handler) reload(w http.ResponseWriter, r *http.Request) {
 	rc := make(chan error)
 	h.reloadCh <- rc
 	if err := <-rc; err != nil {


Test patch:
diff --git a/cmd/prometheus/main_unix_test.go b/cmd/prometheus/main_unix_test.go
index 7224e25d7..b49110ea9 100644
--- a/cmd/prometheus/main_unix_test.go
+++ b/cmd/prometheus/main_unix_test.go
@@ -72,11 +72,9 @@ Loop:
 	if !startedOk {
 		t.Fatal("prometheus didn't start in the specified timeout")
 	}
-	switch err := prom.Process.Kill(); {
-	case err == nil:
+	if err := prom.Process.Kill(); err == nil {
 		t.Errorf("prometheus didn't shutdown gracefully after sending the Interrupt signal")
-	case stoppedErr != nil && stoppedErr.Error() != "signal: interrupt":
-		// TODO: find a better way to detect when the process didn't exit as expected!
+	} else if stoppedErr != nil && stoppedErr.Error() != "signal: interrupt" { // TODO - find a better way to detect when the process didn't exit as expected!
 		t.Errorf("prometheus exited with an unexpected error: %v", stoppedErr)
 	}
 }
diff --git a/cmd/promtool/backfill_test.go b/cmd/promtool/backfill_test.go
index e6f7cad31..2c551abeb 100644
--- a/cmd/promtool/backfill_test.go
+++ b/cmd/promtool/backfill_test.go
@@ -44,7 +44,7 @@ func sortSamples(samples []backfillSample) {
 	})
 }
 
-func queryAllSeries(t testing.TB, q storage.Querier, expectedMinTime, expectedMaxTime int64) []backfillSample { // nolint:revive
+func queryAllSeries(t testing.TB, q storage.Querier, expectedMinTime, expectedMaxTime int64) []backfillSample {
 	ss := q.Select(false, nil, labels.MustNewMatcher(labels.MatchRegexp, "", ".*"))
 	samples := []backfillSample{}
 	for ss.Next() {
diff --git a/cmd/promtool/rules_test.go b/cmd/promtool/rules_test.go
index 213b7d2a0..fb582ed0d 100644
--- a/cmd/promtool/rules_test.go
+++ b/cmd/promtool/rules_test.go
@@ -35,7 +35,7 @@ type mockQueryRangeAPI struct {
 	samples model.Matrix
 }
 
-func (mockAPI mockQueryRangeAPI) QueryRange(_ context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error) { // nolint:revive
+func (mockAPI mockQueryRangeAPI) QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error) {
 	return mockAPI.samples, v1.Warnings{}, nil
 }
 
@@ -161,7 +161,7 @@ func TestBackfillRuleIntegration(t *testing.T) {
 	}
 }
 
-func newTestRuleImporter(_ context.Context, start time.Time, tmpDir string, testSamples model.Matrix, maxBlockDuration time.Duration) (*ruleImporter, error) {
+func newTestRuleImporter(ctx context.Context, start time.Time, tmpDir string, testSamples model.Matrix, maxBlockDuration time.Duration) (*ruleImporter, error) {
 	logger := log.NewNopLogger()
 	cfg := ruleImporterConfig{
 		outputDir:        tmpDir,
diff --git a/cmd/promtool/unittest.go b/cmd/promtool/unittest.go
index b9d8e0527..b3e6f67f9 100644
--- a/cmd/promtool/unittest.go
+++ b/cmd/promtool/unittest.go
@@ -434,7 +434,7 @@ func (tg *testGroup) maxEvalTime() time.Duration {
 }
 
 func query(ctx context.Context, qs string, t time.Time, engine *promql.Engine, qu storage.Queryable) (promql.Vector, error) {
-	q, err := engine.NewInstantQuery(ctx, qu, nil, qs, t)
+	q, err := engine.NewInstantQuery(qu, nil, qs, t)
 	if err != nil {
 		return nil, err
 	}
diff --git a/discovery/legacymanager/manager_test.go b/discovery/legacymanager/manager_test.go
index 13b84e6e3..57c82b72a 100644
--- a/discovery/legacymanager/manager_test.go
+++ b/discovery/legacymanager/manager_test.go
@@ -686,7 +686,12 @@ func TestTargetUpdatesOrder(t *testing.T) {
 				case tgs := <-provUpdates:
 					discoveryManager.updateGroup(poolKey{setName: strconv.Itoa(i), provider: tc.title}, tgs)
 					for _, got := range discoveryManager.allGroups() {
-						assertEqualGroups(t, got, tc.expectedTargets[x])
+						assertEqualGroups(t, got, tc.expectedTargets[x], func(got, expected string) string {
+							return fmt.Sprintf("%d: \ntargets mismatch \ngot: %v \nexpected: %v",
+								x,
+								got,
+								expected)
+						})
 					}
 				}
 			}
@@ -694,7 +699,7 @@ func TestTargetUpdatesOrder(t *testing.T) {
 	}
 }
 
-func assertEqualGroups(t *testing.T, got, expected []*targetgroup.Group) {
+func assertEqualGroups(t *testing.T, got, expected []*targetgroup.Group, msg func(got, expected string) string) {
 	t.Helper()
 
 	// Need to sort by the groups's source as the received order is not guaranteed.
@@ -1074,7 +1079,9 @@ func TestCoordinationWithReceiver(t *testing.T) {
 						if _, ok := tgs[k]; !ok {
 							t.Fatalf("step %d: target group not found: %s\ngot: %#v", i, k, tgs)
 						}
-						assertEqualGroups(t, tgs[k], expected.tgs[k])
+						assertEqualGroups(t, tgs[k], expected.tgs[k], func(got, expected string) string {
+							return fmt.Sprintf("step %d: targets mismatch \ngot: %q \nexpected: %q", i, got, expected)
+						})
 					}
 				}
 			}
diff --git a/discovery/manager_test.go b/discovery/manager_test.go
index 537160811..970168b0f 100644
--- a/discovery/manager_test.go
+++ b/discovery/manager_test.go
@@ -686,7 +686,12 @@ func TestTargetUpdatesOrder(t *testing.T) {
 				case tgs := <-provUpdates:
 					discoveryManager.updateGroup(poolKey{setName: strconv.Itoa(i), provider: tc.title}, tgs)
 					for _, got := range discoveryManager.allGroups() {
-						assertEqualGroups(t, got, tc.expectedTargets[x])
+						assertEqualGroups(t, got, tc.expectedTargets[x], func(got, expected string) string {
+							return fmt.Sprintf("%d: \ntargets mismatch \ngot: %v \nexpected: %v",
+								x,
+								got,
+								expected)
+						})
 					}
 				}
 			}
@@ -694,7 +699,7 @@ func TestTargetUpdatesOrder(t *testing.T) {
 	}
 }
 
-func assertEqualGroups(t *testing.T, got, expected []*targetgroup.Group) {
+func assertEqualGroups(t *testing.T, got, expected []*targetgroup.Group, msg func(got, expected string) string) {
 	t.Helper()
 
 	// Need to sort by the groups's source as the received order is not guaranteed.
@@ -1124,7 +1129,7 @@ type lockStaticConfig struct {
 }
 
 func (s lockStaticConfig) Name() string { return "lockstatic" }
-func (s lockStaticConfig) NewDiscoverer(DiscovererOptions) (Discoverer, error) {
+func (s lockStaticConfig) NewDiscoverer(options DiscovererOptions) (Discoverer, error) {
 	return (lockStaticDiscoverer)(s), nil
 }
 
@@ -1325,7 +1330,9 @@ func TestCoordinationWithReceiver(t *testing.T) {
 						if _, ok := tgs[k]; !ok {
 							t.Fatalf("step %d: target group not found: %s\ngot: %#v", i, k, tgs)
 						}
-						assertEqualGroups(t, tgs[k], expected.tgs[k])
+						assertEqualGroups(t, tgs[k], expected.tgs[k], func(got, expected string) string {
+							return fmt.Sprintf("step %d: targets mismatch \ngot: %q \nexpected: %q", i, got, expected)
+						})
 					}
 				}
 			}
@@ -1392,7 +1399,7 @@ func (o onceProvider) Run(_ context.Context, ch chan<- []*targetgroup.Group) {
 
 // TestTargetSetTargetGroupsUpdateDuringApplyConfig is used to detect races when
 // ApplyConfig happens at the same time as targets update.
-func TestTargetSetTargetGroupsUpdateDuringApplyConfig(*testing.T) {
+func TestTargetSetTargetGroupsUpdateDuringApplyConfig(t *testing.T) {
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
 	discoveryManager := NewManager(ctx, log.NewNopLogger())
diff --git a/promql/bench_test.go b/promql/bench_test.go
index 4ece16bfe..88025d932 100644
--- a/promql/bench_test.go
+++ b/promql/bench_test.go
@@ -27,7 +27,7 @@ import (
 	"github.com/prometheus/prometheus/util/teststorage"
 )
 
-func setupRangeQueryTestData(stor *teststorage.TestStorage, _ *Engine, interval, numIntervals int) error {
+func setupRangeQueryTestData(stor *teststorage.TestStorage, engine *Engine, interval, numIntervals int) error {
 	metrics := []labels.Labels{}
 	metrics = append(metrics, labels.FromStrings("__name__", "a_one"))
 	metrics = append(metrics, labels.FromStrings("__name__", "b_one"))
@@ -240,17 +240,16 @@ func BenchmarkRangeQuery(b *testing.B) {
 	for _, c := range cases {
 		name := fmt.Sprintf("expr=%s,steps=%d", c.expr, c.steps)
 		b.Run(name, func(b *testing.B) {
-			ctx := context.Background()
 			b.ReportAllocs()
 			for i := 0; i < b.N; i++ {
 				qry, err := engine.NewRangeQuery(
-					ctx, stor, nil, c.expr,
+					stor, nil, c.expr,
 					time.Unix(int64((numIntervals-c.steps)*10), 0),
 					time.Unix(int64(numIntervals*10), 0), time.Second*10)
 				if err != nil {
 					b.Fatal(err)
 				}
-				res := qry.Exec(ctx)
+				res := qry.Exec(context.Background())
 				if res.Err != nil {
 					b.Fatal(res.Err)
 				}
diff --git a/promql/engine_test.go b/promql/engine_test.go
index 2941a2240..b64e32ba4 100644
--- a/promql/engine_test.go
+++ b/promql/engine_test.go
@@ -231,14 +231,14 @@ func TestQueryError(t *testing.T) {
 	ctx, cancelCtx := context.WithCancel(context.Background())
 	defer cancelCtx()
 
-	vectorQuery, err := engine.NewInstantQuery(ctx, queryable, nil, "foo", time.Unix(1, 0))
+	vectorQuery, err := engine.NewInstantQuery(queryable, nil, "foo", time.Unix(1, 0))
 	require.NoError(t, err)
 
 	res := vectorQuery.Exec(ctx)
 	require.Error(t, res.Err, "expected error on failed select but got none")
 	require.True(t, errors.Is(res.Err, errStorage), "expected error doesn't match")
 
-	matrixQuery, err := engine.NewInstantQuery(ctx, queryable, nil, "foo[1m]", time.Unix(1, 0))
+	matrixQuery, err := engine.NewInstantQuery(queryable, nil, "foo[1m]", time.Unix(1, 0))
 	require.NoError(t, err)
 
 	res = matrixQuery.Exec(ctx)
@@ -564,15 +564,14 @@ func TestSelectHintsSetCorrectly(t *testing.T) {
 				query Query
 				err   error
 			)
-			ctx := context.Background()
 			if tc.end == 0 {
-				query, err = engine.NewInstantQuery(ctx, hintsRecorder, nil, tc.query, timestamp.Time(tc.start))
+				query, err = engine.NewInstantQuery(hintsRecorder, nil, tc.query, timestamp.Time(tc.start))
 			} else {
-				query, err = engine.NewRangeQuery(ctx, hintsRecorder, nil, tc.query, timestamp.Time(tc.start), timestamp.Time(tc.end), time.Second)
+				query, err = engine.NewRangeQuery(hintsRecorder, nil, tc.query, timestamp.Time(tc.start), timestamp.Time(tc.end), time.Second)
 			}
 			require.NoError(t, err)
 
-			res := query.Exec(ctx)
+			res := query.Exec(context.Background())
 			require.NoError(t, res.Err)
 
 			require.Equal(t, tc.expected, hintsRecorder.hints)
@@ -728,9 +727,9 @@ load 10s
 			var err error
 			var qry Query
 			if c.Interval == 0 {
-				qry, err = test.QueryEngine().NewInstantQuery(test.context, test.Queryable(), nil, c.Query, c.Start)
+				qry, err = test.QueryEngine().NewInstantQuery(test.Queryable(), nil, c.Query, c.Start)
 			} else {
-				qry, err = test.QueryEngine().NewRangeQuery(test.context, test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
+				qry, err = test.QueryEngine().NewRangeQuery(test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
 			}
 			require.NoError(t, err)
 
@@ -1205,9 +1204,9 @@ load 10s
 				var err error
 				var qry Query
 				if c.Interval == 0 {
-					qry, err = engine.NewInstantQuery(test.context, test.Queryable(), opts, c.Query, c.Start)
+					qry, err = engine.NewInstantQuery(test.Queryable(), opts, c.Query, c.Start)
 				} else {
-					qry, err = engine.NewRangeQuery(test.context, test.Queryable(), opts, c.Query, c.Start, c.End, c.Interval)
+					qry, err = engine.NewRangeQuery(test.Queryable(), opts, c.Query, c.Start, c.End, c.Interval)
 				}
 				require.NoError(t, err)
 
@@ -1388,9 +1387,9 @@ load 10s
 				var err error
 				var qry Query
 				if c.Interval == 0 {
-					qry, err = engine.NewInstantQuery(test.context, test.Queryable(), nil, c.Query, c.Start)
+					qry, err = engine.NewInstantQuery(test.Queryable(), nil, c.Query, c.Start)
 				} else {
-					qry, err = engine.NewRangeQuery(test.context, test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
+					qry, err = engine.NewRangeQuery(test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
 				}
 				require.NoError(t, err)
 
@@ -1629,9 +1628,9 @@ load 1ms
 			var err error
 			var qry Query
 			if c.end == 0 {
-				qry, err = test.QueryEngine().NewInstantQuery(test.context, test.Queryable(), nil, c.query, start)
+				qry, err = test.QueryEngine().NewInstantQuery(test.Queryable(), nil, c.query, start)
 			} else {
-				qry, err = test.QueryEngine().NewRangeQuery(test.context, test.Queryable(), nil, c.query, start, end, interval)
+				qry, err = test.QueryEngine().NewRangeQuery(test.Queryable(), nil, c.query, start, end, interval)
 			}
 			require.NoError(t, err)
 
@@ -1962,7 +1961,7 @@ func TestSubquerySelector(t *testing.T) {
 			engine := test.QueryEngine()
 			for _, c := range tst.cases {
 				t.Run(c.Query, func(t *testing.T) {
-					qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, c.Query, c.Start)
+					qry, err := engine.NewInstantQuery(test.Queryable(), nil, c.Query, c.Start)
 					require.NoError(t, err)
 
 					res := qry.Exec(test.Context())
@@ -2910,7 +2909,6 @@ func TestPreprocessAndWrapWithStepInvariantExpr(t *testing.T) {
 }
 
 func TestEngineOptsValidation(t *testing.T) {
-	ctx := context.Background()
 	cases := []struct {
 		opts     EngineOpts
 		query    string
@@ -2970,8 +2968,8 @@ func TestEngineOptsValidation(t *testing.T) {
 
 	for _, c := range cases {
 		eng := NewEngine(c.opts)
-		_, err1 := eng.NewInstantQuery(ctx, nil, nil, c.query, time.Unix(10, 0))
-		_, err2 := eng.NewRangeQuery(ctx, nil, nil, c.query, time.Unix(0, 0), time.Unix(10, 0), time.Second)
+		_, err1 := eng.NewInstantQuery(nil, nil, c.query, time.Unix(10, 0))
+		_, err2 := eng.NewRangeQuery(nil, nil, c.query, time.Unix(0, 0), time.Unix(10, 0), time.Second)
 		if c.fail {
 			require.Equal(t, c.expError, err1)
 			require.Equal(t, c.expError, err2)
@@ -3118,7 +3116,7 @@ func TestRangeQuery(t *testing.T) {
 			err = test.Run()
 			require.NoError(t, err)
 
-			qry, err := test.QueryEngine().NewRangeQuery(test.context, test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
+			qry, err := test.QueryEngine().NewRangeQuery(test.Queryable(), nil, c.Query, c.Start, c.End, c.Interval)
 			require.NoError(t, err)
 
 			res := qry.Exec(test.Context())
@@ -3149,7 +3147,7 @@ func TestNativeHistogramRate(t *testing.T) {
 	engine := test.QueryEngine()
 
 	queryString := fmt.Sprintf("rate(%s[1m])", seriesName)
-	qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(int64(5*time.Minute/time.Millisecond)))
+	qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(int64(5*time.Minute/time.Millisecond)))
 	require.NoError(t, err)
 	res := qry.Exec(test.Context())
 	require.NoError(t, res.Err)
@@ -3193,7 +3191,7 @@ func TestNativeFloatHistogramRate(t *testing.T) {
 	engine := test.QueryEngine()
 
 	queryString := fmt.Sprintf("rate(%s[1m])", seriesName)
-	qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(int64(5*time.Minute/time.Millisecond)))
+	qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(int64(5*time.Minute/time.Millisecond)))
 	require.NoError(t, err)
 	res := qry.Exec(test.Context())
 	require.NoError(t, res.Err)
@@ -3257,7 +3255,7 @@ func TestNativeHistogram_HistogramCountAndSum(t *testing.T) {
 			require.NoError(t, app.Commit())
 
 			queryString := fmt.Sprintf("histogram_count(%s)", seriesName)
-			qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(ts))
+			qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(ts))
 			require.NoError(t, err)
 
 			res := qry.Exec(test.Context())
@@ -3275,7 +3273,7 @@ func TestNativeHistogram_HistogramCountAndSum(t *testing.T) {
 			}
 
 			queryString = fmt.Sprintf("histogram_sum(%s)", seriesName)
-			qry, err = engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(ts))
+			qry, err = engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(ts))
 			require.NoError(t, err)
 
 			res = qry.Exec(test.Context())
@@ -3511,7 +3509,7 @@ func TestNativeHistogram_HistogramQuantile(t *testing.T) {
 				for j, sc := range c.subCases {
 					t.Run(fmt.Sprintf("%d %s", j, sc.quantile), func(t *testing.T) {
 						queryString := fmt.Sprintf("histogram_quantile(%s, %s)", sc.quantile, seriesName)
-						qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(ts))
+						qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(ts))
 						require.NoError(t, err)
 
 						res := qry.Exec(test.Context())
@@ -3942,7 +3940,7 @@ func TestNativeHistogram_HistogramFraction(t *testing.T) {
 				for j, sc := range c.subCases {
 					t.Run(fmt.Sprintf("%d %s %s", j, sc.lower, sc.upper), func(t *testing.T) {
 						queryString := fmt.Sprintf("histogram_fraction(%s, %s, %s)", sc.lower, sc.upper, seriesName)
-						qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(ts))
+						qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(ts))
 						require.NoError(t, err)
 
 						res := qry.Exec(test.Context())
@@ -4079,7 +4077,7 @@ func TestNativeHistogram_Sum_Count_AddOperator(t *testing.T) {
 				require.NoError(t, app.Commit())
 
 				queryAndCheck := func(queryString string, exp Vector) {
-					qry, err := engine.NewInstantQuery(test.context, test.Queryable(), nil, queryString, timestamp.Time(ts))
+					qry, err := engine.NewInstantQuery(test.Queryable(), nil, queryString, timestamp.Time(ts))
 					require.NoError(t, err)
 
 					res := qry.Exec(test.Context())
@@ -4188,7 +4186,7 @@ metric 0 1 2
 			opts := &QueryOpts{
 				LookbackDelta: c.queryLookback,
 			}
-			qry, err := eng.NewInstantQuery(test.context, test.Queryable(), opts, query, c.ts)
+			qry, err := eng.NewInstantQuery(test.Queryable(), opts, query, c.ts)
 			require.NoError(t, err)
 
 			res := qry.Exec(test.Context())
diff --git a/promql/functions_test.go b/promql/functions_test.go
index 8df5684b8..e552424b3 100644
--- a/promql/functions_test.go
+++ b/promql/functions_test.go
@@ -56,11 +56,10 @@ func TestDeriv(t *testing.T) {
 
 	require.NoError(t, a.Commit())
 
-	ctx := context.Background()
-	query, err := engine.NewInstantQuery(ctx, storage, nil, "deriv(foo[30m])", timestamp.Time(1493712846939))
+	query, err := engine.NewInstantQuery(storage, nil, "deriv(foo[30m])", timestamp.Time(1493712846939))
 	require.NoError(t, err)
 
-	result := query.Exec(ctx)
+	result := query.Exec(context.Background())
 	require.NoError(t, result.Err)
 
 	vec, _ := result.Vector()
diff --git a/promql/promql_test.go b/promql/promql_test.go
index a07a0f5cb..68bfa1d95 100644
--- a/promql/promql_test.go
+++ b/promql/promql_test.go
@@ -81,15 +81,14 @@ func TestConcurrentRangeQueries(t *testing.T) {
 			defer func() {
 				sem <- struct{}{}
 			}()
-			ctx := context.Background()
 			qry, err := engine.NewRangeQuery(
-				ctx, stor, nil, c.expr,
+				stor, nil, c.expr,
 				time.Unix(int64((numIntervals-c.steps)*10), 0),
 				time.Unix(int64(numIntervals*10), 0), time.Second*10)
 			if err != nil {
 				return err
 			}
-			res := qry.Exec(ctx)
+			res := qry.Exec(context.Background())
 			if res.Err != nil {
 				t.Logf("Query: %q, steps: %d, result: %s", c.expr, c.steps, res.Err)
 				return res.Err
diff --git a/promql/test.go b/promql/test.go
index 64fa66d5d..0b3958393 100644
--- a/promql/test.go
+++ b/promql/test.go
@@ -538,7 +538,7 @@ func (t *Test) exec(tc testCommand) error {
 		}
 		queries = append([]atModifierTestCase{{expr: cmd.expr, evalTime: cmd.start}}, queries...)
 		for _, iq := range queries {
-			q, err := t.QueryEngine().NewInstantQuery(t.context, t.storage, nil, iq.expr, iq.evalTime)
+			q, err := t.QueryEngine().NewInstantQuery(t.storage, nil, iq.expr, iq.evalTime)
 			if err != nil {
 				return err
 			}
@@ -560,7 +560,7 @@ func (t *Test) exec(tc testCommand) error {
 
 			// Check query returns same result in range mode,
 			// by checking against the middle step.
-			q, err = t.queryEngine.NewRangeQuery(t.context, t.storage, nil, iq.expr, iq.evalTime.Add(-time.Minute), iq.evalTime.Add(time.Minute), time.Minute)
+			q, err = t.queryEngine.NewRangeQuery(t.storage, nil, iq.expr, iq.evalTime.Add(-time.Minute), iq.evalTime.Add(time.Minute), time.Minute)
 			if err != nil {
 				return err
 			}
diff --git a/rules/alerting_test.go b/rules/alerting_test.go
index 8cd0da281..13aab9804 100644
--- a/rules/alerting_test.go
+++ b/rules/alerting_test.go
@@ -587,10 +587,10 @@ func TestAlertingRuleLimit(t *testing.T) {
 	evalTime := time.Unix(0, 0)
 
 	for _, test := range tests {
-		switch _, err := rule.Eval(suite.Context(), evalTime, EngineQueryFunc(suite.QueryEngine(), suite.Storage()), nil, test.limit); {
-		case err != nil:
+		_, err := rule.Eval(suite.Context(), evalTime, EngineQueryFunc(suite.QueryEngine(), suite.Storage()), nil, test.limit)
+		if err != nil {
 			require.EqualError(t, err, test.err)
-		case test.err != "":
+		} else if test.err != "" {
 			t.Errorf("Expected errror %s, got none", test.err)
 		}
 	}
diff --git a/rules/manager_test.go b/rules/manager_test.go
index 26a790964..440e06c9a 100644
--- a/rules/manager_test.go
+++ b/rules/manager_test.go
@@ -481,18 +481,17 @@ func TestForStateRestore(t *testing.T) {
 		})
 
 		// Checking if we have restored it correctly.
-		switch {
-		case tst.noRestore:
+		if tst.noRestore {
 			require.Equal(t, tst.num, len(got))
 			for _, e := range got {
 				require.Equal(t, e.ActiveAt, restoreTime)
 			}
-		case tst.gracePeriod:
+		} else if tst.gracePeriod {
 			require.Equal(t, tst.num, len(got))
 			for _, e := range got {
 				require.Equal(t, opts.ForGracePeriod, e.ActiveAt.Add(alertForDuration).Sub(restoreTime))
 			}
-		default:
+		} else {
 			exp := tst.alerts
 			require.Equal(t, len(exp), len(got))
 			sortAlerts(exp)
@@ -780,13 +779,13 @@ func TestUpdate(t *testing.T) {
 			rgs.Groups[i].Interval = model.Duration(10)
 		}
 	}
-	reloadAndValidate(rgs, t, tmpFile, ruleManager, ogs)
+	reloadAndValidate(rgs, t, tmpFile, ruleManager, expected, ogs)
 
 	// Update limit and reload.
 	for i := range rgs.Groups {
 		rgs.Groups[i].Limit = 1
 	}
-	reloadAndValidate(rgs, t, tmpFile, ruleManager, ogs)
+	reloadAndValidate(rgs, t, tmpFile, ruleManager, expected, ogs)
 
 	// Change group rules and reload.
 	for i, g := range rgs.Groups {
@@ -794,7 +793,7 @@ func TestUpdate(t *testing.T) {
 			rgs.Groups[i].Rules[j].Expr.SetString(fmt.Sprintf("%s * 0", r.Expr.Value))
 		}
 	}
-	reloadAndValidate(rgs, t, tmpFile, ruleManager, ogs)
+	reloadAndValidate(rgs, t, tmpFile, ruleManager, expected, ogs)
 }
 
 // ruleGroupsTest for running tests over rules.
@@ -837,7 +836,7 @@ func formatRules(r *rulefmt.RuleGroups) ruleGroupsTest {
 	}
 }
 
-func reloadAndValidate(rgs *rulefmt.RuleGroups, t *testing.T, tmpFile *os.File, ruleManager *Manager, ogs map[string]*Group) {
+func reloadAndValidate(rgs *rulefmt.RuleGroups, t *testing.T, tmpFile *os.File, ruleManager *Manager, expected map[string]labels.Labels, ogs map[string]*Group) {
 	bs, err := yaml.Marshal(formatRules(rgs))
 	require.NoError(t, err)
 	tmpFile.Seek(0, 0)
diff --git a/rules/origin_test.go b/rules/origin_test.go
index ea4f4f905..dd8e47f74 100644
--- a/rules/origin_test.go
+++ b/rules/origin_test.go
@@ -30,19 +30,19 @@ type unknownRule struct{}
 
 func (u unknownRule) Name() string          { return "" }
 func (u unknownRule) Labels() labels.Labels { return labels.EmptyLabels() }
-func (u unknownRule) Eval(context.Context, time.Time, QueryFunc, *url.URL, int) (promql.Vector, error) {
+func (u unknownRule) Eval(ctx context.Context, time time.Time, queryFunc QueryFunc, url *url.URL, i int) (promql.Vector, error) {
 	return nil, nil
 }
-func (u unknownRule) String() string                       { return "" }
-func (u unknownRule) Query() parser.Expr                   { return nil }
-func (u unknownRule) SetLastError(error)                   {}
-func (u unknownRule) LastError() error                     { return nil }
-func (u unknownRule) SetHealth(RuleHealth)                 {}
-func (u unknownRule) Health() RuleHealth                   { return "" }
-func (u unknownRule) SetEvaluationDuration(time.Duration)  {}
-func (u unknownRule) GetEvaluationDuration() time.Duration { return 0 }
-func (u unknownRule) SetEvaluationTimestamp(time.Time)     {}
-func (u unknownRule) GetEvaluationTimestamp() time.Time    { return time.Time{} }
+func (u unknownRule) String() string                               { return "" }
+func (u unknownRule) Query() parser.Expr                           { return nil }
+func (u unknownRule) SetLastError(err error)                       {}
+func (u unknownRule) LastError() error                             { return nil }
+func (u unknownRule) SetHealth(health RuleHealth)                  {}
+func (u unknownRule) Health() RuleHealth                           { return "" }
+func (u unknownRule) SetEvaluationDuration(duration time.Duration) {}
+func (u unknownRule) GetEvaluationDuration() time.Duration         { return 0 }
+func (u unknownRule) SetEvaluationTimestamp(time time.Time)        {}
+func (u unknownRule) GetEvaluationTimestamp() time.Time            { return time.Time{} }
 
 func TestNewRuleDetailPanics(t *testing.T) {
 	require.PanicsWithValue(t, `unknown rule type "rules.unknownRule"`, func() {
diff --git a/rules/recording_test.go b/rules/recording_test.go
index 35a0b1a0b..61f47e048 100644
--- a/rules/recording_test.go
+++ b/rules/recording_test.go
@@ -223,10 +223,10 @@ func TestRecordingRuleLimit(t *testing.T) {
 	evalTime := time.Unix(0, 0)
 
 	for _, test := range tests {
-		switch _, err := rule.Eval(suite.Context(), evalTime, EngineQueryFunc(suite.QueryEngine(), suite.Storage()), nil, test.limit); {
-		case err != nil:
+		_, err := rule.Eval(suite.Context(), evalTime, EngineQueryFunc(suite.QueryEngine(), suite.Storage()), nil, test.limit)
+		if err != nil {
 			require.EqualError(t, err, test.err)
-		case test.err != "":
+		} else if test.err != "" {
 			t.Errorf("Expected error %s, got none", test.err)
 		}
 	}
diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go
index 6b4b2d5f5..dcb3b48c1 100644
--- a/scrape/scrape_test.go
+++ b/scrape/scrape_test.go
@@ -724,10 +724,9 @@ func TestScrapeLoopStop(t *testing.T) {
 	// All samples in a scrape must have the same timestamp.
 	var ts int64
 	for i, s := range appender.result {
-		switch {
-		case i%6 == 0:
+		if i%6 == 0 {
 			ts = s.t
-		case s.t != ts:
+		} else if s.t != ts {
 			t.Fatalf("Unexpected multiple timestamps within single scrape")
 		}
 	}
@@ -1140,11 +1139,10 @@ func TestScrapeLoopRunCreatesStaleMarkersOnFailedScrape(t *testing.T) {
 	scraper.scrapeFunc = func(ctx context.Context, w io.Writer) error {
 		numScrapes++
 
-		switch numScrapes {
-		case 1:
+		if numScrapes == 1 {
 			w.Write([]byte("metric_a 42\n"))
 			return nil
-		case 5:
+		} else if numScrapes == 5 {
 			cancel()
 		}
 		return errors.New("scrape failed")
@@ -1202,14 +1200,13 @@ func TestScrapeLoopRunCreatesStaleMarkersOnParseFailure(t *testing.T) {
 	scraper.scrapeFunc = func(ctx context.Context, w io.Writer) error {
 		numScrapes++
 
-		switch numScrapes {
-		case 1:
+		if numScrapes == 1 {
 			w.Write([]byte("metric_a 42\n"))
 			return nil
-		case 2:
+		} else if numScrapes == 2 {
 			w.Write([]byte("7&-\n"))
 			return nil
-		case 3:
+		} else if numScrapes == 3 {
 			cancel()
 		}
 		return errors.New("scrape failed")
@@ -1268,15 +1265,14 @@ func TestScrapeLoopCache(t *testing.T) {
 	numScrapes := 0
 
 	scraper.scrapeFunc = func(ctx context.Context, w io.Writer) error {
-		switch numScrapes {
-		case 1, 2:
+		if numScrapes == 1 || numScrapes == 2 {
 			if _, ok := sl.cache.series["metric_a"]; !ok {
 				t.Errorf("metric_a missing from cache after scrape %d", numScrapes)
 			}
 			if _, ok := sl.cache.series["metric_b"]; !ok {
 				t.Errorf("metric_b missing from cache after scrape %d", numScrapes)
 			}
-		case 3:
+		} else if numScrapes == 3 {
 			if _, ok := sl.cache.series["metric_a"]; !ok {
 				t.Errorf("metric_a missing from cache after scrape %d", numScrapes)
 			}
@@ -1287,14 +1283,13 @@ func TestScrapeLoopCache(t *testing.T) {
 
 		numScrapes++
 
-		switch numScrapes {
-		case 1:
+		if numScrapes == 1 {
 			w.Write([]byte("metric_a 42\nmetric_b 43\n"))
 			return nil
-		case 3:
+		} else if numScrapes == 3 {
 			w.Write([]byte("metric_a 44\n"))
 			return nil
-		case 4:
+		} else if numScrapes == 4 {
 			cancel()
 		}
 		return fmt.Errorf("scrape failed")
@@ -2285,12 +2280,11 @@ func TestTargetScrapeScrapeCancel(t *testing.T) {
 
 	go func() {
 		_, err := ts.scrape(ctx, io.Discard)
-		switch {
-		case err == nil:
+		if err == nil {
 			errc <- errors.New("Expected error but got nil")
-		case ctx.Err() != context.Canceled:
+		} else if ctx.Err() != context.Canceled {
 			errc <- errors.Errorf("Expected context cancellation error but got: %s", ctx.Err())
-		default:
+		} else {
 			close(errc)
 		}
 	}()
@@ -2411,7 +2405,7 @@ type testScraper struct {
 	scrapeFunc func(context.Context, io.Writer) error
 }
 
-func (ts *testScraper) offset(time.Duration, uint64) time.Duration {
+func (ts *testScraper) offset(interval time.Duration, jitterSeed uint64) time.Duration {
 	return ts.offsetDur
 }
 
@@ -2873,7 +2867,7 @@ func TestScrapeAddFast(t *testing.T) {
 	require.NoError(t, slApp.Commit())
 }
 
-func TestReuseCacheRace(*testing.T) {
+func TestReuseCacheRace(t *testing.T) {
 	var (
 		app = &nopAppendable{}
 		cfg = &config.ScrapeConfig{
diff --git a/scrape/target_test.go b/scrape/target_test.go
index 9d25df414..2bc3f000c 100644
--- a/scrape/target_test.go
+++ b/scrape/target_test.go
@@ -134,7 +134,7 @@ func TestTargetURL(t *testing.T) {
 	require.Equal(t, expectedURL, target.URL())
 }
 
-func newTestTarget(targetURL string, _ time.Duration, lbls labels.Labels) *Target {
+func newTestTarget(targetURL string, deadline time.Duration, lbls labels.Labels) *Target {
 	lb := labels.NewBuilder(lbls)
 	lb.Set(model.SchemeLabel, "http")
 	lb.Set(model.AddressLabel, strings.TrimPrefix(targetURL, "http://"))
diff --git a/storage/buffer_test.go b/storage/buffer_test.go
index fcb43c273..ebe24d8df 100644
--- a/storage/buffer_test.go
+++ b/storage/buffer_test.go
@@ -188,8 +188,8 @@ func BenchmarkBufferedSeriesIterator(b *testing.B) {
 	b.ReportAllocs()
 	b.ResetTimer()
 
-	for it.Next() != chunkenc.ValNone { // nolint:revive
-		// Scan everything.
+	for it.Next() != chunkenc.ValNone {
+		// scan everything
 	}
 	require.NoError(b, it.Err())
 }
diff --git a/storage/fanout_test.go b/storage/fanout_test.go
index b4490636d..4996e8f64 100644
--- a/storage/fanout_test.go
+++ b/storage/fanout_test.go
@@ -233,7 +233,7 @@ func (errQuerier) Select(bool, *storage.SelectHints, ...*labels.Matcher) storage
 	return storage.ErrSeriesSet(errSelect)
 }
 
-func (errQuerier) LabelValues(string, ...*labels.Matcher) ([]string, storage.Warnings, error) {
+func (errQuerier) LabelValues(name string, matchers ...*labels.Matcher) ([]string, storage.Warnings, error) {
 	return nil, nil, errors.New("label values error")
 }
 
diff --git a/storage/memoized_iterator_test.go b/storage/memoized_iterator_test.go
index d996436e0..382c84e63 100644
--- a/storage/memoized_iterator_test.go
+++ b/storage/memoized_iterator_test.go
@@ -82,8 +82,8 @@ func BenchmarkMemoizedSeriesIterator(b *testing.B) {
 	b.ReportAllocs()
 	b.ResetTimer()
 
-	for it.Next() != chunkenc.ValNone { // nolint:revive
-		// Scan everything.
+	for it.Next() != chunkenc.ValNone {
+		// scan everything
 	}
 	require.NoError(b, it.Err())
 }
diff --git a/storage/remote/codec_test.go b/storage/remote/codec_test.go
index 27e2cc704..36d0d7c31 100644
--- a/storage/remote/codec_test.go
+++ b/storage/remote/codec_test.go
@@ -524,7 +524,7 @@ func TestDecodeWriteRequest(t *testing.T) {
 	require.Equal(t, writeRequestFixture, actual)
 }
 
-func TestNilHistogramProto(*testing.T) {
+func TestNilHistogramProto(t *testing.T) {
 	// This function will panic if it impromperly handles nil
 	// values, causing the test to fail.
 	HistogramProtoToHistogram(prompb.Histogram{})
diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go
index a57c3bf7b..5ec52de6b 100644
--- a/storage/remote/queue_manager_test.go
+++ b/storage/remote/queue_manager_test.go
@@ -362,7 +362,7 @@ func TestReshard(t *testing.T) {
 	c.waitForExpectedData(t)
 }
 
-func TestReshardRaceWithStop(*testing.T) {
+func TestReshardRaceWithStop(t *testing.T) {
 	c := NewTestWriteClient()
 	var m *QueueManager
 	h := sync.Mutex{}
@@ -864,10 +864,10 @@ func (c *TestBlockingWriteClient) Endpoint() string {
 // For benchmarking the send and not the receive side.
 type NopWriteClient struct{}
 
-func NewNopWriteClient() *NopWriteClient                      { return &NopWriteClient{} }
-func (c *NopWriteClient) Store(context.Context, []byte) error { return nil }
-func (c *NopWriteClient) Name() string                        { return "nopwriteclient" }
-func (c *NopWriteClient) Endpoint() string                    { return "http://test-remote.com/1234" }
+func NewNopWriteClient() *NopWriteClient                            { return &NopWriteClient{} }
+func (c *NopWriteClient) Store(_ context.Context, req []byte) error { return nil }
+func (c *NopWriteClient) Name() string                              { return "nopwriteclient" }
+func (c *NopWriteClient) Endpoint() string                          { return "http://test-remote.com/1234" }
 
 func BenchmarkSampleSend(b *testing.B) {
 	// Send one sample per series, which is the typical remote_write case
diff --git a/storage/remote/write_handler_test.go b/storage/remote/write_handler_test.go
index e7a88ddc2..9c787f17e 100644
--- a/storage/remote/write_handler_test.go
+++ b/storage/remote/write_handler_test.go
@@ -294,7 +294,7 @@ func (m *mockAppendable) AppendExemplar(_ storage.SeriesRef, l labels.Labels, e
 	return 0, nil
 }
 
-func (m *mockAppendable) AppendHistogram(_ storage.SeriesRef, l labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
+func (m *mockAppendable) AppendHistogram(ref storage.SeriesRef, l labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
 	if t < m.latestHistogram {
 		return 0, storage.ErrOutOfOrderSample
 	}
diff --git a/tsdb/chunkenc/float_histogram_test.go b/tsdb/chunkenc/float_histogram_test.go
index 90c16d1ea..31d96ee7a 100644
--- a/tsdb/chunkenc/float_histogram_test.go
+++ b/tsdb/chunkenc/float_histogram_test.go
@@ -111,7 +111,7 @@ func TestFloatHistogramChunkSameBuckets(t *testing.T) {
 
 	// 3. Now recycle an iterator that was never used to access anything.
 	itX := c.Iterator(nil)
-	for itX.Next() == ValFloatHistogram { // nolint:revive
+	for itX.Next() == ValFloatHistogram {
 		// Just iterate through without accessing anything.
 	}
 	it3 := c.iterator(itX)
diff --git a/tsdb/chunkenc/histogram_test.go b/tsdb/chunkenc/histogram_test.go
index 45f31a3b4..4bb146ccd 100644
--- a/tsdb/chunkenc/histogram_test.go
+++ b/tsdb/chunkenc/histogram_test.go
@@ -116,7 +116,7 @@ func TestHistogramChunkSameBuckets(t *testing.T) {
 
 	// 3. Now recycle an iterator that was never used to access anything.
 	itX := c.Iterator(nil)
-	for itX.Next() == ValHistogram { // nolint:revive
+	for itX.Next() == ValHistogram {
 		// Just iterate through without accessing anything.
 	}
 	it3 := c.iterator(itX)
diff --git a/tsdb/chunks/head_chunks_test.go b/tsdb/chunks/head_chunks_test.go
index 20a4c2064..ac89ae3e5 100644
--- a/tsdb/chunks/head_chunks_test.go
+++ b/tsdb/chunks/head_chunks_test.go
@@ -503,10 +503,10 @@ func createChunkDiskMapper(t *testing.T, dir string) *ChunkDiskMapper {
 
 func randomChunk(t *testing.T) chunkenc.Chunk {
 	chunk := chunkenc.NewXORChunk()
-	length := rand.Int() % 120
+	len := rand.Int() % 120
 	app, err := chunk.Appender()
 	require.NoError(t, err)
-	for i := 0; i < length; i++ {
+	for i := 0; i < len; i++ {
 		app.Append(rand.Int63(), rand.Float64())
 	}
 	return chunk
diff --git a/tsdb/compact_test.go b/tsdb/compact_test.go
index 93bca179e..d9a105f22 100644
--- a/tsdb/compact_test.go
+++ b/tsdb/compact_test.go
@@ -467,8 +467,8 @@ func (erringBReader) Size() int64                            { return 0 }
 
 type nopChunkWriter struct{}
 
-func (nopChunkWriter) WriteChunks(...chunks.Meta) error { return nil }
-func (nopChunkWriter) Close() error                     { return nil }
+func (nopChunkWriter) WriteChunks(chunks ...chunks.Meta) error { return nil }
+func (nopChunkWriter) Close() error                            { return nil }
 
 func samplesForRange(minTime, maxTime int64, maxSamplesPerChunk int) (ret [][]sample) {
 	var curr []sample
diff --git a/tsdb/db_test.go b/tsdb/db_test.go
index 3e4d35f87..c54fccf6f 100644
--- a/tsdb/db_test.go
+++ b/tsdb/db_test.go
@@ -1426,11 +1426,11 @@ type mockCompactorFailing struct {
 	max    int
 }
 
-func (*mockCompactorFailing) Plan(string) ([]string, error) {
+func (*mockCompactorFailing) Plan(dir string) ([]string, error) {
 	return nil, nil
 }
 
-func (c *mockCompactorFailing) Write(dest string, _ BlockReader, _, _ int64, _ *BlockMeta) (ulid.ULID, error) {
+func (c *mockCompactorFailing) Write(dest string, b BlockReader, mint, maxt int64, parent *BlockMeta) (ulid.ULID, error) {
 	if len(c.blocks) >= c.max {
 		return ulid.ULID{}, fmt.Errorf("the compactor already did the maximum allowed blocks so it is time to fail")
 	}
@@ -1458,7 +1458,7 @@ func (*mockCompactorFailing) Compact(string, []string, []*Block) (ulid.ULID, err
 	return ulid.ULID{}, nil
 }
 
-func (*mockCompactorFailing) CompactOOO(string, *OOOCompactionHead) (result []ulid.ULID, err error) {
+func (*mockCompactorFailing) CompactOOO(dest string, oooHead *OOOCompactionHead) (result []ulid.ULID, err error) {
 	return nil, fmt.Errorf("mock compaction failing CompactOOO")
 }
 
diff --git a/tsdb/goversion/goversion_test.go b/tsdb/goversion/goversion_test.go
index 853844fb9..9a7486d66 100644
--- a/tsdb/goversion/goversion_test.go
+++ b/tsdb/goversion/goversion_test.go
@@ -24,4 +24,4 @@ import (
 //
 // The blank import above is actually what invokes the test of this package. If
 // the import succeeds (the code compiles), the test passed.
-func Test(*testing.T) {}
+func Test(t *testing.T) {}
diff --git a/tsdb/head_test.go b/tsdb/head_test.go
index a183e99c0..e80c197b2 100644
--- a/tsdb/head_test.go
+++ b/tsdb/head_test.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many legitimately empty blocks in this file.
 package tsdb
 
 import (
@@ -104,7 +103,7 @@ func BenchmarkHeadAppender_Append_Commit_ExistingSeries(b *testing.B) {
 					b.Cleanup(func() { require.NoError(b, h.Close()) })
 
 					ts := int64(1000)
-					appendSamples := func() error {
+					append := func() error {
 						var err error
 						app := h.Appender(context.Background())
 						for _, s := range series[:seriesCount] {
@@ -121,13 +120,13 @@ func BenchmarkHeadAppender_Append_Commit_ExistingSeries(b *testing.B) {
 					}
 
 					// Init series, that's not what we're benchmarking here.
-					require.NoError(b, appendSamples())
+					require.NoError(b, append())
 
 					b.ReportAllocs()
 					b.ResetTimer()
 
 					for i := 0; i < b.N; i++ {
-						require.NoError(b, appendSamples())
+						require.NoError(b, append())
 					}
 				})
 			}
@@ -2960,11 +2959,10 @@ func TestAppendHistogram(t *testing.T) {
 			actHistograms := make([]tsdbutil.Sample, 0, len(expHistograms))
 			actFloatHistograms := make([]tsdbutil.Sample, 0, len(expFloatHistograms))
 			for typ := it.Next(); typ != chunkenc.ValNone; typ = it.Next() {
-				switch typ {
-				case chunkenc.ValHistogram:
+				if typ == chunkenc.ValHistogram {
 					ts, h := it.AtHistogram()
 					actHistograms = append(actHistograms, sample{t: ts, h: h})
-				case chunkenc.ValFloatHistogram:
+				} else if typ == chunkenc.ValFloatHistogram {
 					ts, fh := it.AtFloatHistogram()
 					actFloatHistograms = append(actFloatHistograms, sample{t: ts, fh: fh})
 				}
@@ -3566,15 +3564,14 @@ func testHistogramStaleSampleHelper(t *testing.T, floatHistogram bool) {
 		for i, eh := range expHistograms {
 			ah := actHistograms[i]
 			if floatHistogram {
-				switch {
-				case value.IsStaleNaN(eh.fh.Sum):
+				if value.IsStaleNaN(eh.fh.Sum) {
 					actNumStale++
 					require.True(t, value.IsStaleNaN(ah.fh.Sum))
 					// To make require.Equal work.
 					ah.fh.Sum = 0
 					eh.fh = eh.fh.Copy()
 					eh.fh.Sum = 0
-				case i > 0:
+				} else if i > 0 {
 					prev := expHistograms[i-1]
 					if prev.fh == nil || value.IsStaleNaN(prev.fh.Sum) {
 						eh.fh.CounterResetHint = histogram.UnknownCounterReset
@@ -3582,15 +3579,14 @@ func testHistogramStaleSampleHelper(t *testing.T, floatHistogram bool) {
 				}
 				require.Equal(t, eh, ah)
 			} else {
-				switch {
-				case value.IsStaleNaN(eh.h.Sum):
+				if value.IsStaleNaN(eh.h.Sum) {
 					actNumStale++
 					require.True(t, value.IsStaleNaN(ah.h.Sum))
 					// To make require.Equal work.
 					ah.h.Sum = 0
 					eh.h = eh.h.Copy()
 					eh.h.Sum = 0
-				case i > 0:
+				} else if i > 0 {
 					prev := expHistograms[i-1]
 					if prev.h == nil || value.IsStaleNaN(prev.h.Sum) {
 						eh.h.CounterResetHint = histogram.UnknownCounterReset
@@ -4491,19 +4487,19 @@ func TestHistogramValidation(t *testing.T) {
 
 	for testName, tc := range tests {
 		t.Run(testName, func(t *testing.T) {
-			switch err := ValidateHistogram(tc.h); {
-			case tc.errMsg != "":
+			err := ValidateHistogram(tc.h)
+			if tc.errMsg != "" {
 				require.ErrorContains(t, err, tc.errMsg)
-			default:
+			} else {
 				require.NoError(t, err)
 			}
 
-			switch err := ValidateFloatHistogram(tc.h.ToFloat()); {
-			case tc.errMsgFloat != "":
+			err = ValidateFloatHistogram(tc.h.ToFloat())
+			if tc.errMsgFloat != "" {
 				require.ErrorContains(t, err, tc.errMsgFloat)
-			case tc.errMsg != "":
+			} else if tc.errMsg != "" {
 				require.ErrorContains(t, err, tc.errMsg)
-			default:
+			} else {
 				require.NoError(t, err)
 			}
 		})
diff --git a/tsdb/index/postings_test.go b/tsdb/index/postings_test.go
index a34f3c12d..1b1ecd3c3 100644
--- a/tsdb/index/postings_test.go
+++ b/tsdb/index/postings_test.go
@@ -54,7 +54,7 @@ func TestMemPostings_ensureOrder(t *testing.T) {
 		p.m["a"][v] = l
 	}
 
-	p.EnsureOrder(0)
+	p.EnsureOrder()
 
 	for _, e := range p.m {
 		for _, l := range e {
@@ -114,7 +114,7 @@ func BenchmarkMemPostings_ensureOrder(b *testing.B) {
 			b.ResetTimer()
 
 			for n := 0; n < b.N; n++ {
-				p.EnsureOrder(0)
+				p.EnsureOrder()
 				p.ordered = false
 			}
 		})
diff --git a/tsdb/querier_bench_test.go b/tsdb/querier_bench_test.go
index 89758a1d3..78993d105 100644
--- a/tsdb/querier_bench_test.go
+++ b/tsdb/querier_bench_test.go
@@ -250,7 +250,7 @@ func BenchmarkQuerierSelect(b *testing.B) {
 				b.ResetTimer()
 				for i := 0; i < b.N; i++ {
 					ss := q.Select(sorted, nil, matcher)
-					for ss.Next() { // nolint:revive
+					for ss.Next() {
 					}
 					require.NoError(b, ss.Err())
 				}
diff --git a/tsdb/querier_test.go b/tsdb/querier_test.go
index 3a92e4951..fa3dd2418 100644
--- a/tsdb/querier_test.go
+++ b/tsdb/querier_test.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many unsued function arguments in this file by design.
 package tsdb
 
 import (
diff --git a/tsdb/wlog/reader_test.go b/tsdb/wlog/reader_test.go
index 737520e76..97d251b3a 100644
--- a/tsdb/wlog/reader_test.go
+++ b/tsdb/wlog/reader_test.go
@@ -533,7 +533,7 @@ func TestReaderData(t *testing.T) {
 			require.NoError(t, err)
 
 			reader := fn(sr)
-			for reader.Next() { // nolint:revive
+			for reader.Next() {
 			}
 			require.NoError(t, reader.Err())
 
diff --git a/tsdb/wlog/wlog_test.go b/tsdb/wlog/wlog_test.go
index d36934bbd..ed8a9df2e 100644
--- a/tsdb/wlog/wlog_test.go
+++ b/tsdb/wlog/wlog_test.go
@@ -164,7 +164,7 @@ func TestWALRepair_ReadingError(t *testing.T) {
 				sr := NewSegmentBufReader(s)
 				require.NoError(t, err)
 				r := NewReader(sr)
-				for r.Next() { // nolint:revive
+				for r.Next() {
 				}
 
 				// Close the segment so we don't break things on Windows.
diff --git a/util/logging/dedupe_test.go b/util/logging/dedupe_test.go
index e05d6454c..ad234445b 100644
--- a/util/logging/dedupe_test.go
+++ b/util/logging/dedupe_test.go
@@ -22,7 +22,7 @@ import (
 
 type counter int
 
-func (c *counter) Log(...interface{}) error {
+func (c *counter) Log(keyvals ...interface{}) error {
 	(*c)++
 	return nil
 }
diff --git a/util/testutil/context.go b/util/testutil/context.go
index c1f4a831c..cf730421b 100644
--- a/util/testutil/context.go
+++ b/util/testutil/context.go
@@ -37,6 +37,6 @@ func (c *MockContext) Err() error {
 }
 
 // Value ignores the Value and always returns nil
-func (c *MockContext) Value(interface{}) interface{} {
+func (c *MockContext) Value(key interface{}) interface{} {
 	return nil
 }
diff --git a/util/testutil/roundtrip.go b/util/testutil/roundtrip.go
index 364e0c264..a93991a13 100644
--- a/util/testutil/roundtrip.go
+++ b/util/testutil/roundtrip.go
@@ -22,7 +22,7 @@ type roundTrip struct {
 	theError    error
 }
 
-func (rt *roundTrip) RoundTrip(*http.Request) (*http.Response, error) {
+func (rt *roundTrip) RoundTrip(r *http.Request) (*http.Response, error) {
 	return rt.theResponse, rt.theError
 }
 
diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go
index 04aab31af..efce04221 100644
--- a/web/api/v1/api_test.go
+++ b/web/api/v1/api_test.go
@@ -2560,9 +2560,9 @@ type fakeDB struct {
 	err error
 }
 
-func (f *fakeDB) CleanTombstones() error                        { return f.err }
-func (f *fakeDB) Delete(int64, int64, ...*labels.Matcher) error { return f.err }
-func (f *fakeDB) Snapshot(string, bool) error                   { return f.err }
+func (f *fakeDB) CleanTombstones() error                               { return f.err }
+func (f *fakeDB) Delete(mint, maxt int64, ms ...*labels.Matcher) error { return f.err }
+func (f *fakeDB) Snapshot(dir string, withHead bool) error             { return f.err }
 func (f *fakeDB) Stats(statsByLabelName string) (_ *tsdb.Stats, retErr error) {
 	dbDir, err := os.MkdirTemp("", "tsdb-api-ready")
 	if err != nil {
diff --git a/web/api/v1/errors_test.go b/web/api/v1/errors_test.go
index 4947afd81..da0d4b3f2 100644
--- a/web/api/v1/errors_test.go
+++ b/web/api/v1/errors_test.go
@@ -11,7 +11,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// nolint:revive // Many unsued function arguments in this file by design.
 package v1
 
 import (
diff --git a/web/federate_test.go b/web/federate_test.go
index 61ef62f46..76d4b9cf6 100644
--- a/web/federate_test.go
+++ b/web/federate_test.go
@@ -388,13 +388,13 @@ func TestFederationWithNativeHistograms(t *testing.T) {
 			break
 		}
 		require.NoError(t, err)
+		if et == textparse.EntryHelp {
+			metricFamilies++
+		}
 		if et == textparse.EntryHistogram || et == textparse.EntrySeries {
 			p.Metric(&l)
 		}
-		switch et {
-		case textparse.EntryHelp:
-			metricFamilies++
-		case textparse.EntryHistogram:
+		if et == textparse.EntryHistogram {
 			_, parsedTimestamp, h, fh := p.Histogram()
 			require.Nil(t, h)
 			actVec = append(actVec, promql.Sample{
@@ -402,7 +402,7 @@ func TestFederationWithNativeHistograms(t *testing.T) {
 				H:      fh,
 				Metric: l,
 			})
-		case textparse.EntrySeries:
+		} else if et == textparse.EntrySeries {
 			_, parsedTimestamp, f := p.Series()
 			actVec = append(actVec, promql.Sample{
 				T:      *parsedTimestamp,