mirror of
https://github.com/coredns/coredns.git
synced 2026-10-08 19:45:21 -04:00
core: upgrade Go requirement to 1.26.0 (#8466)
* core: upgrade Go requirement to 1.26.0 As golang 1.27 has been released, this PR - Bump Go version requirement to 1.26.0 - Update Go build version to 1.27.0 This is also for solving the issue encountered in 8092 of k8s update Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Bump golang ci Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Fix Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Migrate faillint to forbidigo, as failint has not bee updated for more than a year Signed-off-by: Yong Tang <yong.tang.github@outlook.com> --------- Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -313,21 +312,3 @@ func importtype(s string) string {
|
||||
}
|
||||
return "std"
|
||||
}
|
||||
|
||||
// TestPrometheusImports tests the imports path used for metrics. It depends on faillint to be installed: go install github.com/fatih/faillint
|
||||
func TestPrometheusImports(t *testing.T) {
|
||||
if _, err := exec.LookPath("faillint"); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Not executing TestPrometheusImports: faillint not found\n")
|
||||
return
|
||||
}
|
||||
|
||||
// make this multiline?
|
||||
p := `github.com/prometheus/client_golang/prometheus.{NewCounter,NewCounterVec,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistorgram,NewHistogramVec,NewSummary,NewSummaryVec}=github.com/prometheus/client_golang/prometheus/promauto.{NewCounter,NewCounterVec,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,NewHistorgram,NewHistogramVec,NewSummary,NewSummaryVec}`
|
||||
|
||||
cmd := exec.Command("faillint", "-paths", p, "./...")
|
||||
cmd.Dir = ".."
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed: %s\n%s", err, out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user