Skip to content

Commit e971983

Browse files
pkcllcursoragent
andcommitted
Fix chipingress lint failures for whitespace and noctx.
Remove an unnecessary blank line in NewEvent and use net.ListenConfig in tests instead of deprecated net.Listen. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fdb6dee commit e971983

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

pkg/chipingress/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ func WithResourceAttributeExtensions(attrs map[string]string) EventOpt {
325325

326326
// NewEvent creates a new CloudEvent with the specified domain, entity, payload, and optional attributes.
327327
func NewEvent(domain, entity string, payload []byte, attributes map[string]any, opts ...EventOpt) (CloudEvent, error) {
328-
329328
event := ce.NewEvent()
330329
event.SetSource(domain)
331330
event.SetType(entity)

pkg/chipingress/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ func (s *capturingServer) Ping(ctx context.Context, _ *pb.EmptyRequest) (*pb.Pin
750750
// WithHeaderProvider and WithNOPLookup are configured, both providers' headers must reach
751751
// the server, not just the one registered last.
752752
func TestClient_ChainedHeaderProviders(t *testing.T) {
753-
lis, err := net.Listen("tcp", "127.0.0.1:0")
753+
lis, err := (&net.ListenConfig{}).Listen(t.Context(), "tcp", "127.0.0.1:0")
754754
require.NoError(t, err)
755755
defer lis.Close()
756756

pkg/chipingress/header_provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (pingServer) Ping(context.Context, *pb.EmptyRequest) (*pb.PingResponse, err
358358
// value (dots, non-printable characters) reproduces that failure; running it through
359359
// SanitizeMetadataHeaders first must not.
360360
func TestSanitizeMetadataHeaders_AvoidsRPCFailure(t *testing.T) {
361-
lis, err := net.Listen("tcp", "127.0.0.1:0")
361+
lis, err := (&net.ListenConfig{}).Listen(t.Context(), "tcp", "127.0.0.1:0")
362362
require.NoError(t, err)
363363
defer lis.Close()
364364

0 commit comments

Comments
 (0)