From 1ccb0cad1a61d15b5bb4276185b03fe17f018acc Mon Sep 17 00:00:00 2001 From: mikestefanello Date: Sat, 25 Dec 2021 21:04:19 -0500 Subject: [PATCH] Removed unneeded dependency. --- go.mod | 2 +- msg/msg_test.go | 12 +++++------- tests/tests.go | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 04b4394..c2e1442 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/labstack/gommon v0.3.1 github.com/stretchr/testify v1.7.0 golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 - k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3 ) require ( @@ -75,4 +74,5 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/apimachinery v0.0.0-20191123233150-4c4803ed55e3 // indirect ) diff --git a/msg/msg_test.go b/msg/msg_test.go index 5676708..9570885 100644 --- a/msg/msg_test.go +++ b/msg/msg_test.go @@ -8,8 +8,6 @@ import ( "github.com/go-playground/assert/v2" "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/rand" - "github.com/labstack/echo/v4" ) @@ -26,23 +24,23 @@ func TestMsg(t *testing.T) { require.Len(t, ret, 0) } - text := rand.String(10) + text := "aaa" Success(ctx, text) assertMsg(TypeSuccess, text) - text = rand.String(10) + text = "bbb" Info(ctx, text) assertMsg(TypeInfo, text) - text = rand.String(10) + text = "ccc" Danger(ctx, text) assertMsg(TypeDanger, text) - text = rand.String(10) + text = "ddd" Warning(ctx, text) assertMsg(TypeWarning, text) - text = rand.String(10) + text = "eee" Set(ctx, TypeSuccess, text) assertMsg(TypeSuccess, text) } diff --git a/tests/tests.go b/tests/tests.go index 34668cd..5c4a684 100644 --- a/tests/tests.go +++ b/tests/tests.go @@ -3,6 +3,7 @@ package tests import ( "context" "fmt" + "math/rand" "net/http" "net/http/httptest" "strings" @@ -14,8 +15,6 @@ import ( "github.com/go-playground/assert/v2" "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/rand" - "github.com/gorilla/sessions" "github.com/labstack/echo-contrib/session" "github.com/labstack/echo/v4" @@ -46,7 +45,7 @@ func AssertHTTPErrorCode(t *testing.T, err error, code int) { } func CreateUser(orm *ent.Client) (*ent.User, error) { - seed := fmt.Sprintf("%d-%d", time.Now().UnixMilli(), rand.IntnRange(10, 1000000)) + seed := fmt.Sprintf("%d-%d", time.Now().UnixMilli(), rand.Intn(1000000)) return orm.User. Create(). SetEmail(fmt.Sprintf("testuser-%s@localhost.localhost", seed)).