add go version prerequisite and debug warning

This commit is contained in:
thinkerou 2018-06-14 16:18:48 +08:00
parent caf3e350a5
commit 8373cac8f8
3 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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.
`)

View File

@ -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) {