Skip to content

Commit 088cdd7

Browse files
authored
Fix the value of ginSupportMinGoVer constant by semantic (gin-gonic#3221)
1 parent 92dd245 commit 088cdd7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

debug.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313
)
1414

15-
const ginSupportMinGoVer = 14
15+
const ginSupportMinGoVer = 15
1616

1717
// IsDebugging returns true if the framework is running in debug mode.
1818
// Use SetMode(gin.ReleaseMode) to disable debug mode.
@@ -66,7 +66,7 @@ func getMinVer(v string) (uint64, error) {
6666
}
6767

6868
func debugPrintWARNINGDefault() {
69-
if v, e := getMinVer(runtime.Version()); e == nil && v <= ginSupportMinGoVer {
69+
if v, e := getMinVer(runtime.Version()); e == nil && v < ginSupportMinGoVer {
7070
debugPrint(`[WARNING] Now Gin requires Go 1.15+.
7171
7272
`)

debug_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestDebugPrintWARNINGDefault(t *testing.T) {
103103
SetMode(TestMode)
104104
})
105105
m, e := getMinVer(runtime.Version())
106-
if e == nil && m <= ginSupportMinGoVer {
106+
if e == nil && m < ginSupportMinGoVer {
107107
assert.Equal(t, "[GIN-debug] [WARNING] Now Gin requires Go 1.15+.\n\n[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re)
108108
} else {
109109
assert.Equal(t, "[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re)

0 commit comments

Comments
 (0)