diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 524c620..fd15e8c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 @@ -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 \ No newline at end of file + run: go test -v -race ./... \ No newline at end of file diff --git a/go.mod b/go.mod index fe1d4ea..5caef53 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/ovsexporter/ovsexporter_test.go b/internal/ovsexporter/ovsexporter_test.go index 39e08be..c140af3 100644 --- a/internal/ovsexporter/ovsexporter_test.go +++ b/internal/ovsexporter/ovsexporter_test.go @@ -5,7 +5,7 @@ package ovsexporter import ( "bytes" - "io/ioutil" + "io" "net/http" "net/http/httptest" "testing" @@ -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) }