Running golangci-lint: FAIL
level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive."
level=warning msg="[linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649."
pkg/metrics/metrics.go:35: File is not `gofmt`-ed with `-s` (gofmt)
stackType string
pkg/metrics/collector/pod_ip_metrics.go:70:2: var `duplicateIpCountDesc` should be `duplicateIPCountDesc` (golint)
duplicateIpCountDesc = prometheus.NewDesc(
^
pkg/metrics/collector/pod_ip_metrics.go:94:2: var `podIpMetricsWatcherSetup` should be `podIPMetricsWatcherSetup` (golint)
podIpMetricsWatcherSetup = false
^
pkg/metrics/collector/pod_ip_metrics.go:97:6: type `podIpMetricsCollector` should be `podIPMetricsCollector` (golint)
type podIpMetricsCollector struct {
^
pkg/metrics/collector/pod_ip_metrics.go:102:2: struct field `duplicateIpCount` should be `duplicateIPCount` (golint)
duplicateIpCount uint64
^
pkg/metrics/collector/pod_ip_metrics.go:141:6: func NewPodIpMetricsCollector should be NewPodIPMetricsCollector (golint)
func NewPodIpMetricsCollector() (Collector, error) {
^
pkg/metrics/collector/pod_ip_metrics.go:162:33: method listIpAddresses should be listIPAddresses (golint)
func (c *podIpMetricsCollector) listIpAddresses(dir string) error {
^
pkg/metrics/collector/pod_ip_metrics.go:175:28: var `dupIpCount` should be `dupIPCount` (golint)
var ipv4Count, ipv6Count, dupIpCount, dualCount, dualErrCount uint64
^
pkg/metrics/collector/pod_ip_metrics.go:[191](https://github.com/GoogleCloudPlatform/netd/actions/runs/3301658861/jobs/5447391570#step:3:192):3: var `podId` should be `podID` (golint)
podId, err := readLine(fileName)
^
pkg/metrics/collector/pod_ip_metrics.go:235:33: method updateReuseIpStats should be updateReuseIPStats (golint)
func (c *podIpMetricsCollector) updateReuseIpStats(e fsnotify.Event, f string) {
^
pkg/metrics/collector/pod_ip_metrics.go:236:2: var `reuseIp` should be `reuseIP` (golint)
reuseIp, ok := c.reuseMap[f]
^
pkg/metrics/collector/pod_ip_metrics.go:250:5: should replace `c.reuseIps.count += 1` with `c.reuseIps.count++` (golint)
c.reuseIps.count += 1
^
pkg/metrics/collector/pod_ip_metrics_test.go:44:6: func mustCreateIpAddrDir should be mustCreateIPAddrDir (golint)
func mustCreateIpAddrDir(t *testing.T, dir string) string {
^
pkg/metrics/collector/pod_ip_metrics_test.go:87:3: struct field `wantDuplicateIpCount` should be `wantDuplicateIPCount` (golint)
wantDuplicateIpCount uint64
^
pkg/metrics/collector/pod_ip_metrics.go:339:84: unnecessary conversion (unconvert)
ch <- prometheus.MustNewConstMetric(ipReuseAvgDesc, prometheus.GaugeValue, float64((c.reuseIps.sum / float64(c.reuseIps.count))))
^
pkg/metrics/collector/pod_ip_metrics_test.go:22:2: S1023: redundant `return` statement (gosimple)
return
^
pkg/metrics/collector/helper.go:20:2: SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
pkg/metrics/collector/kernel_metrics.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
pkg/metrics/collector/netlink_metrics.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^
pkg/metrics/collector/pod_ip_metrics_test.go:4:2: SA1019: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"io/ioutil"
^