Skip to content

Commit

Permalink
Bump golangci-lint to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrik committed Feb 27, 2024
1 parent 9be354d commit d11caf0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ jobs:
run: go mod verify

- name: Run golangci-lint
uses: golangci/golangci-lint-action@c67416616c29c3c48d26b59c45cadb56966d80aa # https://github.com/golangci/golangci-lint-action/issues/953
uses: golangci/golangci-lint-action@v4
with:
version: v1.54.2
version: v1.56.2
env:
CGO_CFLAGS: "-I${{ github.workspace }}/libbpf/dest/usr/include"

Expand Down
4 changes: 2 additions & 2 deletions cmd/ebpf_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {

libbpfgoCallbacks := libbpfgo.Callbacks{Log: libbpfLogCallback}
if !*debug {
libbpfgoCallbacks.LogFilters = append(libbpfgoCallbacks.LogFilters, func(libLevel int, msg string) bool {
libbpfgoCallbacks.LogFilters = append(libbpfgoCallbacks.LogFilters, func(libLevel int, _ string) bool {
return libLevel == libbpfgo.LibbpfDebugLevel
})
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func main() {
}

http.Handle(*metricsPath, promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
_, err = w.Write([]byte(`<html>
<head><title>eBPF Exporter</title></head>
<body>
Expand Down
8 changes: 4 additions & 4 deletions decoder/pci.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"github.com/jaypipes/pcidb"
)

const pciIdsPath = "/usr/share/misc/pci.ids"
const missingPciIdsText = "missing pci.ids db"
const pciIDsPath = "/usr/share/misc/pci.ids"
const missingPciIDsText = "missing pci.ids db"

var pci *pcidb.PCIDB

func init() {
if _, err := os.Stat(pciIdsPath); err != nil {
log.Printf("PCI DB path %q is not accessible: %v", pciIdsPath, err)
if _, err := os.Stat(pciIDsPath); err != nil {
log.Printf("PCI DB path %q is not accessible: %v", pciIDsPath, err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion decoder/pci_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type PCIClass struct{}
// Decode transforms PCI class id into a name
func (d *PCIClass) Decode(in []byte, _ config.Decoder) ([]byte, error) {
if pci == nil {
return []byte(missingPciIdsText), nil
return []byte(missingPciIDsText), nil
}

num, err := strconv.Atoi(string(in))
Expand Down
2 changes: 1 addition & 1 deletion decoder/pci_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type PCIDevice struct{}
// Decode transforms PCI device id into a name
func (d *PCIDevice) Decode(in []byte, _ config.Decoder) ([]byte, error) {
if pci == nil {
return []byte(missingPciIdsText), nil
return []byte(missingPciIDsText), nil
}

num, err := strconv.Atoi(string(in))
Expand Down
2 changes: 1 addition & 1 deletion decoder/pci_subclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type PCISubClass struct{}
// Decode transforms PCI class id into a name
func (d *PCISubClass) Decode(in []byte, _ config.Decoder) ([]byte, error) {
if pci == nil {
return []byte(missingPciIdsText), nil
return []byte(missingPciIDsText), nil
}

num, err := strconv.Atoi(string(in))
Expand Down
4 changes: 2 additions & 2 deletions decoder/pci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func testPCIMissing(t *testing.T, d Decoder, cases [][]byte) {
t.Errorf("Error decoding %#v: %v", c, err)
}

if !bytes.Equal(out, []byte(missingPciIdsText)) {
t.Errorf("Expected %q, got %s", missingPciIdsText, out)
if !bytes.Equal(out, []byte(missingPciIDsText)) {
t.Errorf("Expected %q, got %s", missingPciIDsText, out)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion decoder/pci_vendor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type PCIVendor struct{}
// Decode transforms PCI vendor id into a name
func (d *PCIVendor) Decode(in []byte, _ config.Decoder) ([]byte, error) {
if pci == nil {
return []byte(missingPciIdsText), nil
return []byte(missingPciIDsText), nil
}

num, err := strconv.Atoi(string(in))
Expand Down
2 changes: 1 addition & 1 deletion tracing/demos/sock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func main() {
_, dialSpan := tracer.Start(ctx, "dial")

dialer := net.Dialer{
Control: func(network, address string, c syscall.RawConn) error {
Control: func(_, _ string, c syscall.RawConn) error {
return c.Control(func(fd uintptr) {
sockSentParentSpan(fd, dialSpan)
connFd = fd
Expand Down

0 comments on commit d11caf0

Please sign in to comment.