Skip to content

Commit e0c771c

Browse files
fix(cmd): resolve golangci-lint errors in test infrastructure
- Explicitly ignore fmt.Fprintf error in printOutput helper - Remove unused setTestClient function - Remove unused server field from MockClient struct All linter checks now pass with zero issues. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 424ad9a commit e0c771c

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

cmd/root.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,9 @@ func getClient() (*client.Client, error) {
130130
return ddClient, nil
131131
}
132132

133-
// setTestClient sets a mock client for testing and returns a cleanup function
134-
func setTestClient(mockClient *client.Client) func() {
135-
original := ddClient
136-
ddClient = mockClient
137-
return func() { ddClient = original }
138-
}
139-
140133
// printOutput writes formatted output (for testing)
141134
func printOutput(format string, a ...any) {
142-
fmt.Fprintf(outputWriter, format, a...)
135+
_, _ = fmt.Fprintf(outputWriter, format, a...)
143136
}
144137

145138
// readConfirmation reads user confirmation from input

cmd/testutil/testutil.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
// MockClient provides a mock Datadog client for testing
2323
type MockClient struct {
2424
*client.Client
25-
server *httptest.Server
2625
}
2726

2827
// NewMockClient creates a mock client that uses a test HTTP server

0 commit comments

Comments
 (0)