@@ -253,7 +253,7 @@ func (s *Service) CreateSession(
253253 key .SessionID = uuid .New ().String ()
254254 }
255255
256- now := time .Now (). UTC ()
256+ now := time .Now ()
257257 sessState := & SessionState {
258258 ID : key .SessionID ,
259259 State : make (session.StateMap ),
@@ -405,7 +405,7 @@ func (s *Service) UpdateAppState(ctx context.Context, appName string, state sess
405405 return session .ErrAppNameRequired
406406 }
407407
408- now := time .Now (). UTC ()
408+ now := time .Now ()
409409 var expiresAt * time.Time
410410 if s .appStateTTL > 0 {
411411 t := now .Add (s .appStateTTL )
@@ -453,7 +453,7 @@ func (s *Service) ListAppStates(ctx context.Context, appName string) (session.St
453453 WHERE app_name = $1
454454 AND (expires_at IS NULL OR expires_at > $2)
455455 AND deleted_at IS NULL` , s .tableAppStates ),
456- appName , time .Now (). UTC () )
456+ appName , time .Now ())
457457
458458 if err != nil {
459459 return nil , fmt .Errorf ("postgres session service list app states failed: %w" , err )
@@ -476,7 +476,7 @@ func (s *Service) DeleteAppState(ctx context.Context, appName string, key string
476476 _ , err = s .pgClient .ExecContext (ctx ,
477477 fmt .Sprintf (`UPDATE %s SET deleted_at = $1
478478 WHERE app_name = $2 AND key = $3 AND deleted_at IS NULL` , s .tableAppStates ),
479- time .Now (). UTC () , appName , key )
479+ time .Now (), appName , key )
480480 } else {
481481 // Hard delete: permanently remove record
482482 _ , err = s .pgClient .ExecContext (ctx ,
@@ -497,7 +497,7 @@ func (s *Service) UpdateUserState(ctx context.Context, userKey session.UserKey,
497497 return err
498498 }
499499
500- now := time .Now (). UTC ()
500+ now := time .Now ()
501501 var expiresAt * time.Time
502502 if s .userStateTTL > 0 {
503503 t := now .Add (s .userStateTTL )
@@ -545,7 +545,7 @@ func (s *Service) ListUserStates(ctx context.Context, userKey session.UserKey) (
545545 WHERE app_name = $1 AND user_id = $2
546546 AND (expires_at IS NULL OR expires_at > $3)
547547 AND deleted_at IS NULL` , s .tableUserStates ),
548- userKey .AppName , userKey .UserID , time .Now (). UTC () )
548+ userKey .AppName , userKey .UserID , time .Now ())
549549
550550 if err != nil {
551551 return nil , fmt .Errorf ("postgres session service list user states failed: %w" , err )
@@ -567,7 +567,7 @@ func (s *Service) DeleteUserState(ctx context.Context, userKey session.UserKey,
567567 _ , err = s .pgClient .ExecContext (ctx ,
568568 fmt .Sprintf (`UPDATE %s SET deleted_at = $1
569569 WHERE app_name = $2 AND user_id = $3 AND key = $4 AND deleted_at IS NULL` , s .tableUserStates ),
570- time .Now (). UTC () , userKey .AppName , userKey .UserID , key )
570+ time .Now (), userKey .AppName , userKey .UserID , key )
571571 } else {
572572 _ , err = s .pgClient .ExecContext (ctx ,
573573 fmt .Sprintf (`DELETE FROM %s
@@ -664,7 +664,7 @@ func (s *Service) getSession(
664664 WHERE app_name = $1 AND user_id = $2 AND session_id = $3
665665 AND (expires_at IS NULL OR expires_at > $4)
666666 AND deleted_at IS NULL` , s .tableSessionStates )
667- stateArgs := []interface {}{key .AppName , key .UserID , key .SessionID , time .Now (). UTC () }
667+ stateArgs := []interface {}{key .AppName , key .UserID , key .SessionID , time .Now ()}
668668
669669 err := s .pgClient .Query (ctx , func (rows * sql.Rows ) error {
670670 if rows .Next () {
@@ -708,7 +708,7 @@ func (s *Service) getSession(
708708 // Query events (always filter deleted records)
709709 // Note: limit here only controls how many events to return, not delete from database
710710 events := []event.Event {}
711- now := time .Now (). UTC ()
711+ now := time .Now ()
712712 var eventQuery string
713713 var eventArgs []interface {}
714714
@@ -761,7 +761,7 @@ func (s *Service) getSession(
761761 WHERE app_name = $1 AND user_id = $2 AND session_id = $3
762762 AND (expires_at IS NULL OR expires_at > $4)
763763 AND deleted_at IS NULL` , s .tableSessionSummaries )
764- summaryArgs := []interface {}{key .AppName , key .UserID , key .SessionID , time .Now (). UTC () }
764+ summaryArgs := []interface {}{key .AppName , key .UserID , key .SessionID , time .Now ()}
765765
766766 err = s .pgClient .Query (ctx , func (rows * sql.Rows ) error {
767767 for rows .Next () {
@@ -822,7 +822,7 @@ func (s *Service) listSessions(
822822 AND (expires_at IS NULL OR expires_at > $3)
823823 AND deleted_at IS NULL
824824 ORDER BY updated_at DESC` , s .tableSessionStates )
825- listArgs := []interface {}{key .AppName , key .UserID , time .Now (). UTC () }
825+ listArgs := []interface {}{key .AppName , key .UserID , time .Now ()}
826826
827827 err = s .pgClient .Query (ctx , func (rows * sql.Rows ) error {
828828 for rows .Next () {
@@ -890,7 +890,7 @@ func (s *Service) listSessions(
890890}
891891
892892func (s * Service ) addEvent (ctx context.Context , key session.Key , event * event.Event ) error {
893- now := time .Now (). UTC ()
893+ now := time .Now ()
894894
895895 // Get current session state (always filter deleted records, but allow expired sessions)
896896 var sessState * SessionState
@@ -1031,7 +1031,7 @@ func (s *Service) enforceEventLimit(ctx context.Context, tx *sql.Tx, key session
10311031// refreshSessionTTL updates the session's updated_at and expires_at timestamps.
10321032// This effectively "renews" the session, extending its lifetime by the configured TTL.
10331033func (s * Service ) refreshSessionTTL (ctx context.Context , key session.Key ) error {
1034- now := time .Now (). UTC ()
1034+ now := time .Now ()
10351035 expiresAt := now .Add (s .sessionTTL )
10361036
10371037 _ , err := s .pgClient .ExecContext (ctx ,
@@ -1051,7 +1051,7 @@ func (s *Service) deleteSessionState(ctx context.Context, key session.Key) error
10511051 err := s .pgClient .Transaction (ctx , func (tx * sql.Tx ) error {
10521052 if s .opts .softDelete {
10531053 // Soft delete: set deleted_at timestamp
1054- now := time .Now (). UTC ()
1054+ now := time .Now ()
10551055
10561056 // Soft delete session state
10571057 _ , err := tx .ExecContext (ctx ,
@@ -1222,7 +1222,7 @@ func (s *Service) getEventsList(
12221222 LIMIT $6
12231223 ) e ON true
12241224 ORDER BY s.session_id` , s .tableSessionEvents )
1225- args = []interface {}{sessionIDs , sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , time .Now (). UTC () , afterTime , limit }
1225+ args = []interface {}{sessionIDs , sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , time .Now (), afterTime , limit }
12261226 } else {
12271227 // Without limit: simple query with IN clause
12281228 query = fmt .Sprintf (`
@@ -1234,7 +1234,7 @@ func (s *Service) getEventsList(
12341234 AND created_at > $5
12351235 AND deleted_at IS NULL
12361236 ORDER BY session_id, created_at DESC` , s .tableSessionEvents )
1237- args = []interface {}{sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , sessionIDs , time .Now (). UTC () , afterTime }
1237+ args = []interface {}{sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , sessionIDs , time .Now (), afterTime }
12381238 }
12391239
12401240 // Execute query and group events by session
@@ -1324,7 +1324,7 @@ func (s *Service) getSummariesList(
13241324 summariesMap [sessionID ][filterKey ] = & sum
13251325 }
13261326 return nil
1327- }, summaryQuery , sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , sessionIDs , time .Now (). UTC () )
1327+ }, summaryQuery , sessionKeys [0 ].AppName , sessionKeys [0 ].UserID , sessionIDs , time .Now ())
13281328
13291329 if err != nil {
13301330 return nil , fmt .Errorf ("query summaries failed: %w" , err )
@@ -1358,7 +1358,7 @@ func (s *Service) cleanupExpiredForUser(ctx context.Context, userKey session.Use
13581358// If userKey is nil, it cleans up all expired data globally.
13591359// If userKey is provided, it only cleans up expired data for that specific user.
13601360func (s * Service ) cleanupExpiredData (ctx context.Context , userKey * session.UserKey ) {
1361- now := time .Now (). UTC ()
1361+ now := time .Now ()
13621362
13631363 // Define cleanup tasks: table name, TTL, and whether it's session-scoped
13641364 type cleanupTask struct {
0 commit comments