File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed
Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff 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-
111106type contextKey string
112107
113108const requestIDKey contextKey = "request_id"
Original file line number Diff line number Diff line change @@ -47,18 +47,6 @@ func TestInitialize(t *testing.T) {
4747}
4848
4949func 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 )
You can’t perform that action at this time.
0 commit comments