Skip to content

Commit 63ade60

Browse files
authored
[receiver/tcpcheckreceiver] unexport Server structs in test files (#40731)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description these structs are not part of config and cannot be exported: Server <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #40677 <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Jared Tan <[email protected]>
1 parent b906a5b commit 63ade60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

receiver/tcpcheckreceiver/scraper_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ import (
2525
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcpcheckreceiver/internal/metadata"
2626
)
2727

28-
type Server struct {
28+
type mockTCPserver struct {
2929
host string
3030
port string
3131
listener net.Listener
3232
}
3333

34-
func newTCPServer(host string, port string) *Server {
35-
return &Server{
34+
func newTCPServer(host string, port string) *mockTCPserver {
35+
return &mockTCPserver{
3636
host: host,
3737
port: port,
3838
}
3939
}
4040

41-
func (server *Server) runTCPServer(t *testing.T) string {
41+
func (server *mockTCPserver) runTCPServer(t *testing.T) string {
4242
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%s", server.host, server.port))
4343
require.NoError(t, err)
4444
server.listener = listener
@@ -50,7 +50,7 @@ func (server *Server) runTCPServer(t *testing.T) string {
5050
return listener.Addr().String()
5151
}
5252

53-
func (server *Server) runTCPServerError() (string, error) {
53+
func (server *mockTCPserver) runTCPServerError() (string, error) {
5454
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%s", server.host, server.port))
5555
if err != nil {
5656
return "", err
@@ -66,7 +66,7 @@ func (server *Server) runTCPServerError() (string, error) {
6666
return listener.Addr().String(), nil
6767
}
6868

69-
func (server *Server) shutdown() {
69+
func (server *mockTCPserver) shutdown() {
7070
server.listener.Close()
7171
}
7272

0 commit comments

Comments
 (0)