Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Nov 2, 2022
1 parent 3527608 commit e404386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/token/manager/jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ func getNextWeekend(now time.Time) time.Time {
}

func setTime(t time.Time, hour, min, sec int) time.Time {
t = t.Truncate(24 * time.Hour)
return t.Add(time.Duration(hour)*time.Hour + time.Duration(min)*time.Minute + time.Duration(sec)*time.Second)
return time.Date(t.Year(), t.Month(), t.Day(), hour, min, sec, 0, t.Location())
}

func (m *manager) DismantleToken(ctx context.Context, tkn string) (*user.User, map[string]*auth.Scope, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/token/manager/jwt/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestSetTi(t *testing.T) {
sec: 10,
expected: time.Date(2022, time.December, 12, 23, 34, 10, 0, time.UTC),
},
{
{
t: time.Date(2022, time.December, 12, 20, 19, 10, 0, time.UTC),
hour: 23,
min: 34,
Expand Down

0 comments on commit e404386

Please sign in to comment.