Skip to content

Commit a2af746

Browse files
committed
removed a useless function and test
1 parent ad877de commit a2af746

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

internal/log/logger.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ func Fatal(msg string, args ...any) {
103103
os.Exit(1)
104104
}
105105

106-
// Request ID utilities
107-
func GenerateRequestID() string {
108-
return fmt.Sprintf("req_%d", time.Now().UnixNano())
109-
}
110-
111106
type contextKey string
112107

113108
const requestIDKey contextKey = "request_id"

internal/log/logger_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ func TestInitialize(t *testing.T) {
4747
}
4848

4949
func TestRequestIDFunctions(t *testing.T) {
50-
t.Run("generates unique request IDs", func(t *testing.T) {
51-
id1 := GenerateRequestID()
52-
id2 := GenerateRequestID()
53-
54-
if id1 == id2 {
55-
t.Error("IDs should be unique")
56-
}
57-
if !strings.HasPrefix(id1, "req_") {
58-
t.Error("ID should have req_ prefix")
59-
}
60-
})
61-
6250
t.Run("context request ID functions", func(t *testing.T) {
6351
ctx := ContextWithRequestID(context.Background(), "test123")
6452
retrieved := RequestIDFromContext(ctx)

0 commit comments

Comments
 (0)