mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 10:02:10 +08:00
add go version prerequisite and debug warning
This commit is contained in:
parent
caf3e350a5
commit
8373cac8f8
14
README.md
14
README.md
@ -15,6 +15,8 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi
|
||||
|
||||
## Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Prerequisite](#prerequisite)
|
||||
- [Quick start](#quick-start)
|
||||
- [Benchmarks](#benchmarks)
|
||||
- [Gin v1.stable](#gin-v1-stable)
|
||||
@ -57,6 +59,18 @@ Gin is a web framework written in Go (Golang). It features a martini-like API wi
|
||||
- [Testing](#testing)
|
||||
- [Users](#users--)
|
||||
|
||||
## Installation
|
||||
|
||||
To install Gin package, you need to install Go and set your Go workspace. The simplest way to install the library is to run:
|
||||
|
||||
```sh
|
||||
$ go get -u github.com/gin-gonic/gin
|
||||
```
|
||||
|
||||
## Prerequisite
|
||||
|
||||
Now Gin requires Go 1.6 or later and Go 1.7 will be required soon.
|
||||
|
||||
## Quick start
|
||||
|
||||
```sh
|
||||
|
3
debug.go
3
debug.go
@ -47,6 +47,9 @@ func debugPrint(format string, values ...interface{}) {
|
||||
}
|
||||
|
||||
func debugPrintWARNINGDefault() {
|
||||
debugPrint(`[WARNING] Now Gin requires Go 1.6 or later and Go 1.7 will be required soon.
|
||||
|
||||
`)
|
||||
debugPrint(`[WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
|
||||
|
||||
`)
|
||||
|
@ -92,7 +92,7 @@ func TestDebugPrintWARNINGDefault(t *testing.T) {
|
||||
defer teardown()
|
||||
|
||||
debugPrintWARNINGDefault()
|
||||
assert.Equal(t, "[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", w.String())
|
||||
assert.Equal(t, "[GIN-debug] [WARNING] Now Gin requires Go 1.6 or later and Go 1.7 will be required soon.\n\n[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", w.String())
|
||||
}
|
||||
|
||||
func TestDebugPrintWARNINGNew(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user