Skip to content

Commit d52aaf9

Browse files
committed
Remove stale nolint:unused directives
These functions/types are now used by the exported BeforeExecute, AfterExecute, and CompleteStatement methods wired into connection.go, so the unused suppression directives are no longer needed. Co-authored-by: samikshya-chand_data
1 parent fa6a0f5 commit d52aaf9

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

telemetry/errors.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
// isTerminalError returns true if error is terminal (non-retryable).
99
// Terminal errors indicate user errors or permanent failures that won't
1010
// be resolved by retrying the operation.
11-
//
12-
//nolint:unused // Will be used in Phase 8+
11+
1312
func isTerminalError(err error) bool {
1413
if err == nil {
1514
return false
@@ -45,8 +44,7 @@ func isTerminalError(err error) bool {
4544

4645
// classifyError classifies an error for telemetry purposes.
4746
// Returns a string representation of the error type.
48-
//
49-
//nolint:unused // Will be used in Phase 8+
47+
5048
func classifyError(err error) string {
5149
if err == nil {
5250
return ""
@@ -89,14 +87,12 @@ func isRetryableError(err error) bool {
8987
}
9088

9189
// httpError represents an HTTP error with status code.
92-
//
93-
//nolint:unused // Will be used in Phase 8+
90+
9491
type httpError struct {
9592
statusCode int
9693
message string
9794
}
9895

99-
//nolint:unused // Will be used in Phase 8+
10096
func (e *httpError) Error() string {
10197
return e.message
10298
}
@@ -112,16 +108,14 @@ func newHTTPError(statusCode int, message string) error {
112108
}
113109

114110
// isTerminalHTTPStatus returns true for non-retryable HTTP status codes.
115-
//
116-
//nolint:unused // Will be used in Phase 8+
111+
117112
func isTerminalHTTPStatus(status int) bool {
118113
// 4xx errors (except 429) are terminal
119114
return status >= 400 && status < 500 && status != 429
120115
}
121116

122117
// extractHTTPError extracts HTTP error information if available.
123-
//
124-
//nolint:unused // Will be used in Phase 8+
118+
125119
func extractHTTPError(err error) (*httpError, bool) {
126120
var httpErr *httpError
127121
if errors.As(err, &httpErr) {

telemetry/interceptor.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ type Interceptor struct {
1515
}
1616

1717
// metricContext holds metric collection state in context.
18-
//
19-
//nolint:unused // Will be used in Phase 8+
2018
type metricContext struct {
2119
sessionID string
2220
statementID string
2321
startTime time.Time
2422
tags map[string]interface{}
2523
}
2624

27-
//nolint:unused // Will be used in Phase 8+
2825
type contextKey int
2926

30-
//nolint:unused // Will be used in Phase 8+
3127
const metricContextKey contextKey = 0
3228

3329
// newInterceptor creates a new telemetry interceptor.
@@ -39,15 +35,11 @@ func newInterceptor(aggregator *metricsAggregator, enabled bool) *Interceptor {
3935
}
4036

4137
// withMetricContext adds metric context to the context.
42-
//
43-
//nolint:unused // Will be used in Phase 8+
4438
func withMetricContext(ctx context.Context, mc *metricContext) context.Context {
4539
return context.WithValue(ctx, metricContextKey, mc)
4640
}
4741

4842
// getMetricContext retrieves metric context from the context.
49-
//
50-
//nolint:unused // Will be used in Phase 8+
5143
func getMetricContext(ctx context.Context) *metricContext {
5244
if mc, ok := ctx.Value(metricContextKey).(*metricContext); ok {
5345
return mc

0 commit comments

Comments
 (0)