mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-07 23:03:11 +08:00
Merge 0a384832da111aa2e2b17056be10eeba5533ee0f into 53295a75a40173538e28ef9c9a8b696b2a5f8117
This commit is contained in:
commit
c46fa5a2ed
19
README.md
19
README.md
@ -13,7 +13,7 @@ $ cat test.go
|
||||
```go
|
||||
package main
|
||||
|
||||
import "gopkg.in/gin-gonic/gin.v1"
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func main() {
|
||||
r := gin.Default()
|
||||
@ -68,7 +68,7 @@ BenchmarkZeus_GithubAll | 2000 | 944234 | 300688 | 2648
|
||||
(3): Heap Memory (B/op)
|
||||
(4): Average Allocations per Repetition (allocs/op)
|
||||
|
||||
## Gin v1. stable
|
||||
## Gin v1.2 develop
|
||||
|
||||
- [x] Zero allocation router.
|
||||
- [x] Still the fastest http router and framework. From routing to writing.
|
||||
@ -78,17 +78,18 @@ BenchmarkZeus_GithubAll | 2000 | 944234 | 300688 | 2648
|
||||
|
||||
|
||||
## Start using it
|
||||
Note: [govendor](https://github.com/kardianos/govendor) is used by Gin for dependency management.
|
||||
|
||||
1. Download and install it:
|
||||
1. Download and install Gin:
|
||||
|
||||
```sh
|
||||
$ go get gopkg.in/gin-gonic/gin.v1
|
||||
$ govendor fetch github.com/gin-gonic/gin@=develop
|
||||
```
|
||||
|
||||
2. Import it in your code:
|
||||
|
||||
```go
|
||||
import "gopkg.in/gin-gonic/gin.v1"
|
||||
import "github.com/gin-gonic/gin"
|
||||
```
|
||||
|
||||
3. (Optional) Import `net/http`. This is required for example if using constants such as `http.StatusOK`.
|
||||
@ -97,14 +98,6 @@ import "gopkg.in/gin-gonic/gin.v1"
|
||||
import "net/http"
|
||||
```
|
||||
|
||||
4. (Optional) Use latest changes (note: they may be broken and/or unstable):
|
||||
|
||||
```sh
|
||||
$ GIN_PATH=$GOPATH/src/gopkg.in/gin-gonic/gin.v1
|
||||
$ git -C $GIN_PATH checkout develop
|
||||
$ git -C $GIN_PATH pull origin develop
|
||||
```
|
||||
|
||||
## API Examples
|
||||
|
||||
### Using GET, POST, PUT, PATCH, DELETE and OPTIONS
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user