summaryrefslogtreecommitdiff
path: root/internal/util
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-24 15:16:06 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-24 15:16:06 +0100
commit5d10e7b2e85b89cb087493279d9c5c9420f0b1e2 (patch)
treef0a63e1bc4f6b46513324f1ad2833102a285889a /internal/util
parentf0ec0be5e833f72fc650ce9d093722838e4f8034 (diff)
Util: Get rid of current time helper
Fixes #5
Diffstat (limited to 'internal/util')
-rw-r--r--internal/util/util.go5
-rw-r--r--internal/util/util_test.go12
2 files changed, 0 insertions, 17 deletions
diff --git a/internal/util/util.go b/internal/util/util.go
index ef52ce2..cbe9c1b 100644
--- a/internal/util/util.go
+++ b/internal/util/util.go
@@ -7,7 +7,6 @@ import (
"os"
"path"
"strings"
- "time"
"github.com/eduvpn/eduvpn-common/types"
)
@@ -49,10 +48,6 @@ func MakeRandomByteSlice(size int) ([]byte, error) {
return byteSlice, nil
}
-func GetCurrentTime() time.Time {
- return time.Now()
-}
-
func EnsureDirectory(directory string) error {
// Create with 700 permissions, read, write, execute only for the owner
mkdirErr := os.MkdirAll(directory, 0o700)
diff --git a/internal/util/util_test.go b/internal/util/util_test.go
index eb1a9f6..dbeec62 100644
--- a/internal/util/util_test.go
+++ b/internal/util/util_test.go
@@ -58,18 +58,6 @@ func Test_MakeRandomByteSlice(t *testing.T) {
}
}
-func Test_GetCurrentTime(t *testing.T) {
- time_now := GetCurrentTime()
-
- time.Sleep(1 * time.Second)
-
- time_after_1_second := GetCurrentTime()
-
- if !time_after_1_second.After(time_now) {
- t.Fatal("Time is not after previous time")
- }
-}
-
func Test_WAYFEncode(t *testing.T) {
// AuthTemplate
returnTo := "127.0.0.1:8000/test123bla/#wow "