From 5d10e7b2e85b89cb087493279d9c5c9420f0b1e2 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 24 Nov 2022 15:16:06 +0100 Subject: Util: Get rid of current time helper Fixes #5 --- internal/util/util.go | 5 ----- internal/util/util_test.go | 12 ------------ 2 files changed, 17 deletions(-) (limited to 'internal/util') 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 " -- cgit v1.2.3