Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: openvswitch_exporter

- uses: actions/checkout@v2
with:
repository: digitalocean/go-openvswitch
path: go-openvswitch

- name: Set up Go
uses: actions/setup-go@v6
Expand All @@ -27,29 +20,23 @@ jobs:

- name: Install tooling
run: |
# Install linting / analysis tools with explicit versions (go get no longer installs binaries)
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
go install golang.org/x/lint/golint@latest
# Ensure GOPATH/bin is on PATH for subsequent steps (actions/setup-go usually does this, but we enforce it)
# Install analysis tools. staticcheck @latest for Go 1.24 compatibility.
go install honnef.co/go/tools/cmd/staticcheck@latest
# golint is deprecated; keep temporarily (will remove in follow-up)
go install golang.org/x/lint/golint@latest || echo "golint install failed (deprecated)"
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
working-directory: openvswitch_exporter

- name: Build
run: go build -v -tags=gofuzz ./...
working-directory: openvswitch_exporter

- name: vet
run: go vet ./...
working-directory: openvswitch_exporter

- name: staticcheck
run: staticcheck ./...
working-directory: openvswitch_exporter

- name: lint
run: golint -set_exit_status ./cmd/... ./internal/...
working-directory: openvswitch_exporter

- name: Test
run: go test -v -race ./...
working-directory: openvswitch_exporter
run: go test -v -race ./...
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ require (
golang.org/x/sys v0.37.0 // indirect
google.golang.org/protobuf v1.23.0 // indirect
)

// replace github.com/digitalocean/go-openvswitch => ../go-openvswitch
4 changes: 2 additions & 2 deletions internal/ovsexporter/ovsexporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package ovsexporter

import (
"bytes"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -33,7 +33,7 @@ func testCollector(t *testing.T, collector prometheus.Collector) []byte {
}
defer resp.Body.Close()

buf, err := ioutil.ReadAll(resp.Body)
buf, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatalf("failed to read server response: %v", err)
}
Expand Down