From 4d2dad596140fa729fb5e67aed2ad9787d3a1901 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 11 Jan 2021 09:07:45 +0800 Subject: [PATCH 1/2] test: fixed the TestUnixSocket test on windows (#2595) Co-authored-by: thinkerou --- gin_integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gin_integration_test.go b/gin_integration_test.go index 5f508c7090..41ad98743b 100644 --- a/gin_integration_test.go +++ b/gin_integration_test.go @@ -14,6 +14,7 @@ import ( "net/http" "net/http/httptest" "os" + "path/filepath" "sync" "testing" "time" @@ -146,7 +147,7 @@ func TestRunWithPort(t *testing.T) { func TestUnixSocket(t *testing.T) { router := New() - unixTestSocket := "/tmp/unix_unit_test" + unixTestSocket := filepath.Join(os.TempDir(), "unix_unit_test") defer os.Remove(unixTestSocket) From e753c502dcbbab6769305871d700c770e68d1b0f Mon Sep 17 00:00:00 2001 From: Rubi <14269809+codenoid@users.noreply.github.com> Date: Mon, 11 Jan 2021 23:03:31 +0700 Subject: [PATCH 2/2] gin mode unknown: show available mode (#2567) Co-authored-by: thinkerou --- mode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode.go b/mode.go index 11f833e9a3..c8813aff26 100644 --- a/mode.go +++ b/mode.go @@ -63,7 +63,7 @@ func SetMode(value string) { case TestMode: ginMode = testCode default: - panic("gin mode unknown: " + value) + panic("gin mode unknown: " + value + " (available mode: debug release test)") } modeName = value