Skip to content

Commit 7fe5df0

Browse files
committed
Added go module files, and implemented a linter suggestion
1 parent c602e18 commit 7fe5df0

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/rajch/voxel-dockerclient
2+
3+
go 1.16
4+
5+
require golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf

go.sum

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o=
2+
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
3+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
4+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
6+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
7+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

server/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func authorize(next http.Handler) http.Handler {
5252
}
5353

5454
// Expire session on extra idle time
55-
if time.Now().Sub(currentsession.lastActionAt).Seconds() > timeOUT {
55+
if time.Since(currentsession.lastActionAt).Seconds() > timeOUT {
5656

5757
// Expire cookie
5858
sessioncookie.Expires = time.Now().AddDate(-1, 0, 0)
@@ -154,7 +154,7 @@ func cleanupSessions() {
154154
sessionsLock.Lock()
155155

156156
for key, value := range currentSessions {
157-
if time.Now().Sub(value.lastActionAt) > (time.Second * timeOUT) {
157+
if time.Since(value.lastActionAt) > (time.Second * timeOUT) {
158158
sessionsToClean = append(sessionsToClean, key)
159159
}
160160
}

0 commit comments

Comments
 (0)