From: Daniel Swarbrick <dswarbrick@debian.org>
Date: Mon, 13 Nov 2023 13:49:27 +0100
Subject: Revert alecthomas/kingpin import path

Forwarded: not-needed
Last-Update: 2025-02-17

Newer versions of alecthomas/kingpin use a different import path. This patch
can be dropped once the golang-gopkg-alecthomas-kingpin.v2-dev package is
updated and provides the new import path.
---
 collector/arp_linux.go             | 2 +-
 collector/bcache_linux.go          | 2 +-
 collector/collector.go             | 2 +-
 collector/cpu_linux.go             | 2 +-
 collector/diskstats_common.go      | 2 +-
 collector/ethtool_linux.go         | 2 +-
 collector/filesystem_common.go     | 2 +-
 collector/filesystem_linux.go      | 2 +-
 collector/filesystem_linux_test.go | 2 +-
 collector/hwmon_linux.go           | 2 +-
 collector/interrupts_common.go     | 2 +-
 collector/ipvs_linux.go            | 2 +-
 collector/ipvs_linux_test.go       | 2 +-
 collector/netclass_linux.go        | 2 +-
 collector/netclass_rtnl_linux.go   | 2 +-
 collector/netdev_common.go         | 2 +-
 collector/netdev_linux.go          | 2 +-
 collector/netstat_linux.go         | 2 +-
 collector/ntp.go                   | 2 +-
 collector/paths.go                 | 2 +-
 collector/paths_test.go            | 2 +-
 collector/perf_linux.go            | 2 +-
 collector/powersupplyclass.go      | 2 +-
 collector/processes_linux_test.go  | 2 +-
 collector/qdisc_linux.go           | 2 +-
 collector/rapl_linux.go            | 2 +-
 collector/runit.go                 | 2 +-
 collector/slabinfo_linux.go        | 2 +-
 collector/stat_linux.go            | 2 +-
 collector/supervisord.go           | 2 +-
 collector/sysctl_linux.go          | 2 +-
 collector/systemd_linux.go         | 2 +-
 collector/tapestats_linux.go       | 2 +-
 collector/textfile.go              | 2 +-
 collector/textfile_test.go         | 2 +-
 collector/vmstat_linux.go          | 2 +-
 collector/wifi_linux.go            | 2 +-
 node_exporter.go                   | 2 +-
 38 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/collector/arp_linux.go b/collector/arp_linux.go
index e1ba52c..76ff985 100644
--- a/collector/arp_linux.go
+++ b/collector/arp_linux.go
@@ -20,11 +20,11 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/jsimonetti/rtnetlink/v2/rtnl"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
 	"golang.org/x/sys/unix"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/bcache_linux.go b/collector/bcache_linux.go
index 97064e2..bb956b6 100644
--- a/collector/bcache_linux.go
+++ b/collector/bcache_linux.go
@@ -20,9 +20,9 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/bcache"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/collector.go b/collector/collector.go
index 9768fb6..04f3a9a 100644
--- a/collector/collector.go
+++ b/collector/collector.go
@@ -21,8 +21,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 // Namespace defines the common namespace to be used by all metrics.
diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go
index 8ca7036..f1f79ba 100644
--- a/collector/cpu_linux.go
+++ b/collector/cpu_linux.go
@@ -29,10 +29,10 @@ import (
 
 	"golang.org/x/exp/maps"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type cpuCollector struct {
diff --git a/collector/diskstats_common.go b/collector/diskstats_common.go
index 593d055..4235415 100644
--- a/collector/diskstats_common.go
+++ b/collector/diskstats_common.go
@@ -21,8 +21,8 @@ import (
 	"errors"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/ethtool_linux.go b/collector/ethtool_linux.go
index 78f7afe..f64e7ef 100644
--- a/collector/ethtool_linux.go
+++ b/collector/ethtool_linux.go
@@ -31,11 +31,11 @@ import (
 	"sync"
 	"syscall"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/sysfs"
 	"github.com/safchain/ethtool"
 	"golang.org/x/sys/unix"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/filesystem_common.go b/collector/filesystem_common.go
index 272366b..27bf53d 100644
--- a/collector/filesystem_common.go
+++ b/collector/filesystem_common.go
@@ -22,8 +22,8 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 // Arch-dependent implementation must define:
diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go
index 81a738c..b1f8c0f 100644
--- a/collector/filesystem_linux.go
+++ b/collector/filesystem_linux.go
@@ -27,8 +27,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"golang.org/x/sys/unix"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/filesystem_linux_test.go b/collector/filesystem_linux_test.go
index d088598..30e8280 100644
--- a/collector/filesystem_linux_test.go
+++ b/collector/filesystem_linux_test.go
@@ -22,7 +22,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/alecthomas/kingpin/v2"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 func Test_parseFilesystemLabelsError(t *testing.T) {
diff --git a/collector/hwmon_linux.go b/collector/hwmon_linux.go
index ad8da41..a4825ec 100644
--- a/collector/hwmon_linux.go
+++ b/collector/hwmon_linux.go
@@ -26,9 +26,9 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"golang.org/x/sys/unix"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/interrupts_common.go b/collector/interrupts_common.go
index 80cd717..abf0d9a 100644
--- a/collector/interrupts_common.go
+++ b/collector/interrupts_common.go
@@ -20,8 +20,8 @@ package collector
 import (
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type interruptsCollector struct {
diff --git a/collector/ipvs_linux.go b/collector/ipvs_linux.go
index 7d7bae5..1143c4e 100644
--- a/collector/ipvs_linux.go
+++ b/collector/ipvs_linux.go
@@ -25,9 +25,9 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type ipvsCollector struct {
diff --git a/collector/ipvs_linux_test.go b/collector/ipvs_linux_test.go
index bc3e40f..d249c02 100644
--- a/collector/ipvs_linux_test.go
+++ b/collector/ipvs_linux_test.go
@@ -27,9 +27,9 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 func TestIPVSCollector(t *testing.T) {
diff --git a/collector/netclass_linux.go b/collector/netclass_linux.go
index 87763c3..fb282bc 100644
--- a/collector/netclass_linux.go
+++ b/collector/netclass_linux.go
@@ -25,9 +25,9 @@ import (
 	"regexp"
 	"sync"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/netclass_rtnl_linux.go b/collector/netclass_rtnl_linux.go
index 44d89f8..9f73275 100644
--- a/collector/netclass_rtnl_linux.go
+++ b/collector/netclass_rtnl_linux.go
@@ -22,11 +22,11 @@ import (
 	"io/fs"
 	"path/filepath"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/jsimonetti/rtnetlink/v2"
 	"github.com/mdlayher/ethtool"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/netdev_common.go b/collector/netdev_common.go
index 7125ae6..da32975 100644
--- a/collector/netdev_common.go
+++ b/collector/netdev_common.go
@@ -25,8 +25,8 @@ import (
 	"strconv"
 	"sync"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/netdev_linux.go b/collector/netdev_linux.go
index 58ac4af..85d72f0 100644
--- a/collector/netdev_linux.go
+++ b/collector/netdev_linux.go
@@ -20,10 +20,10 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/jsimonetti/rtnetlink/v2"
 	"github.com/prometheus/procfs"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/netstat_linux.go b/collector/netstat_linux.go
index 1aa9234..f89b839 100644
--- a/collector/netstat_linux.go
+++ b/collector/netstat_linux.go
@@ -27,8 +27,8 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/ntp.go b/collector/ntp.go
index 10e639b..835fd57 100644
--- a/collector/ntp.go
+++ b/collector/ntp.go
@@ -23,9 +23,9 @@ import (
 	"sync"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/beevik/ntp"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/paths.go b/collector/paths.go
index 82c9418..e887043 100644
--- a/collector/paths.go
+++ b/collector/paths.go
@@ -17,8 +17,8 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/paths_test.go b/collector/paths_test.go
index 9426fa4..eca7b3a 100644
--- a/collector/paths_test.go
+++ b/collector/paths_test.go
@@ -16,8 +16,8 @@ package collector
 import (
 	"testing"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 func TestDefaultProcPath(t *testing.T) {
diff --git a/collector/perf_linux.go b/collector/perf_linux.go
index b62d9b8..091cf39 100644
--- a/collector/perf_linux.go
+++ b/collector/perf_linux.go
@@ -23,10 +23,10 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/hodgesds/perf-utils"
 	"github.com/prometheus/client_golang/prometheus"
 	"golang.org/x/sys/unix"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/powersupplyclass.go b/collector/powersupplyclass.go
index a5e648c..111fc0c 100644
--- a/collector/powersupplyclass.go
+++ b/collector/powersupplyclass.go
@@ -21,8 +21,8 @@ import (
 	"log/slog"
 	"regexp"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/processes_linux_test.go b/collector/processes_linux_test.go
index c50d16c..50e1bd2 100644
--- a/collector/processes_linux_test.go
+++ b/collector/processes_linux_test.go
@@ -21,8 +21,8 @@ import (
 	"log/slog"
 	"testing"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 func TestReadProcessStatus(t *testing.T) {
diff --git a/collector/qdisc_linux.go b/collector/qdisc_linux.go
index 93a78e3..120a230 100644
--- a/collector/qdisc_linux.go
+++ b/collector/qdisc_linux.go
@@ -23,9 +23,9 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/ema/qdisc"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type qdiscStatCollector struct {
diff --git a/collector/rapl_linux.go b/collector/rapl_linux.go
index 25d78f2..0822ffa 100644
--- a/collector/rapl_linux.go
+++ b/collector/rapl_linux.go
@@ -23,9 +23,9 @@ import (
 	"os"
 	"strconv"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const raplCollectorSubsystem = "rapl"
diff --git a/collector/runit.go b/collector/runit.go
index 2813bfd..b3b7855 100644
--- a/collector/runit.go
+++ b/collector/runit.go
@@ -19,9 +19,9 @@ package collector
 import (
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus-community/go-runit/runit"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var runitServiceDir = kingpin.Flag("collector.runit.servicedir", "Path to runit service directory.").Default("/etc/service").String()
diff --git a/collector/slabinfo_linux.go b/collector/slabinfo_linux.go
index aa87154..2353dfb 100644
--- a/collector/slabinfo_linux.go
+++ b/collector/slabinfo_linux.go
@@ -20,9 +20,9 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/stat_linux.go b/collector/stat_linux.go
index 0b99cc3..584f004 100644
--- a/collector/stat_linux.go
+++ b/collector/stat_linux.go
@@ -20,9 +20,9 @@ import (
 	"fmt"
 	"log/slog"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type statCollector struct {
diff --git a/collector/supervisord.go b/collector/supervisord.go
index ae5e229..f44fefd 100644
--- a/collector/supervisord.go
+++ b/collector/supervisord.go
@@ -25,9 +25,9 @@ import (
 	"net/url"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/mattn/go-xmlrpc"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/sysctl_linux.go b/collector/sysctl_linux.go
index ac7022f..1461972 100644
--- a/collector/sysctl_linux.go
+++ b/collector/sysctl_linux.go
@@ -19,9 +19,9 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/systemd_linux.go b/collector/systemd_linux.go
index b1a7ebf..e8df7f4 100644
--- a/collector/systemd_linux.go
+++ b/collector/systemd_linux.go
@@ -27,9 +27,9 @@ import (
 	"sync"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/coreos/go-systemd/v22/dbus"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/tapestats_linux.go b/collector/tapestats_linux.go
index c74c11d..835554a 100644
--- a/collector/tapestats_linux.go
+++ b/collector/tapestats_linux.go
@@ -22,9 +22,9 @@ import (
 	"os"
 	"regexp"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/procfs/sysfs"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/textfile.go b/collector/textfile.go
index e04499d..1298419 100644
--- a/collector/textfile.go
+++ b/collector/textfile.go
@@ -25,10 +25,10 @@ import (
 	"strings"
 	"time"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	"github.com/prometheus/common/expfmt"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 var (
diff --git a/collector/textfile_test.go b/collector/textfile_test.go
index ece70b3..ab5aebb 100644
--- a/collector/textfile_test.go
+++ b/collector/textfile_test.go
@@ -25,11 +25,11 @@ import (
 	"os"
 	"testing"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/prometheus/common/promslog"
 	"github.com/prometheus/common/promslog/flag"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type collectorAdapter struct {
diff --git a/collector/vmstat_linux.go b/collector/vmstat_linux.go
index e31be0f..7a9cc76 100644
--- a/collector/vmstat_linux.go
+++ b/collector/vmstat_linux.go
@@ -25,8 +25,8 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 const (
diff --git a/collector/wifi_linux.go b/collector/wifi_linux.go
index c84cdd7..17c1b2f 100644
--- a/collector/wifi_linux.go
+++ b/collector/wifi_linux.go
@@ -24,9 +24,9 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/mdlayher/wifi"
 	"github.com/prometheus/client_golang/prometheus"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 type wifiCollector struct {
diff --git a/node_exporter.go b/node_exporter.go
index 88441e1..5e41afd 100644
--- a/node_exporter.go
+++ b/node_exporter.go
@@ -27,7 +27,6 @@ import (
 	"github.com/prometheus/common/promslog"
 	"github.com/prometheus/common/promslog/flag"
 
-	"github.com/alecthomas/kingpin/v2"
 	"github.com/prometheus/client_golang/prometheus"
 	promcollectors "github.com/prometheus/client_golang/prometheus/collectors"
 	versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version"
@@ -36,6 +35,7 @@ import (
 	"github.com/prometheus/exporter-toolkit/web"
 	"github.com/prometheus/exporter-toolkit/web/kingpinflag"
 	"github.com/prometheus/node_exporter/collector"
+	"gopkg.in/alecthomas/kingpin.v2"
 )
 
 // handler wraps an unfiltered http.Handler but uses a filtered handler,
