Skip to content

Commit

Permalink
[chore] remove method using a deprecated struct
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Feb 9, 2024
1 parent 074ff65 commit bcd9ef1
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions collector/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ import (
"net"
"os/exec"
"runtime"
"strconv"
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"go.opentelemetry.io/collector/service/telemetry"
)

type portpair struct {
Expand Down Expand Up @@ -57,22 +54,6 @@ func GetAvailableLocalAddress(t testing.TB) string {
return endpoint
}

func GetAvailableLocalAddressPrometheus(t testing.TB) *telemetry.Prometheus {
address := GetAvailableLocalAddress(t)
host, port, err := net.SplitHostPort(address)
if err != nil {
return nil
}
portInt, err := strconv.Atoi(port)
if err != nil {
return nil
}
return &telemetry.Prometheus{
Host: &host,
Port: &portInt,
}
}

func findAvailableAddress(t testing.TB) string {
ln, err := net.Listen("tcp", "localhost:0")
require.NoError(t, err, "Failed to get a free local port")
Expand Down

0 comments on commit bcd9ef1

Please sign in to comment.