func SetDetails(r *http.Request, path string, params map[string]string) *http.Request {

	// Retrieve request id from header.
	requestID := r.Header.Get("X-Request-ID")
	if requestID == "" {
		// Create request id if not found in header.
		requestID = ksuid.New().String()
	}

	d := details{
		Now:         time.Now(),
		RequestID:   requestID,
		Method:      r.Method,
		RequestPath: path,
		Params:      params,
	}

	// Add details to the context, so other functions can access them.
	ctx := context.WithValue(r.Context(), keyDetails, &d)

	return r.WithContext(ctx)
}
// SetDetails adds the required details into the given request's context. The returned request should then be used.
SetDetails adds the required details into the given request's context. The returned request should then be used.
// SetDetails adds the required details into the given request ' s context . The returned request should then be used .
func SetDetails(r *http.Request, path string, params map[string]string) *http.Request {
	requestID := r.Header.Get("X-Request-ID")
	if requestID == "" {
		requestID = ksuid.New().String()
	}
	d := details{
		Now:         time.Now(),
		RequestID:   requestID,
		Method:      r.Method,
		RequestPath: path,
		Params:      params,
	}
	ctx := context.WithValue(r.Context(), keyDetails, &d)
	return r.WithContext(ctx)
}
func SetDetails ( r * http . Request , path string , params map [ string ] string ) * http . Request { requestID := r . Header . Get ( " " ) if requestID == " " { requestID = ksuid . New ( ) . String ( ) } d := details { Now : time . Now ( ) , RequestID : requestID , Method : r . Method , RequestPath : path , Params : params , } ctx := context . WithValue ( r . Context ( ) , keyDetails , & d ) return r . WithContext ( ctx ) }
SetDetails adds the required details into the given request's context.
SetDetails adds the required details into the given request ' s context .
// Retrieve request id from header. // Create request id if not found in header. // Add details to the context, so other functions can access them.