fix(import): adjust import path

This commit is contained in:
Eason Lin
2017-07-07 00:57:54 +08:00
parent ee961b2c60
commit 27e43b231e
6 changed files with 23 additions and 22 deletions
+12 -12
View File
@@ -2,29 +2,29 @@
gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
[![Travis branch](https://img.shields.io/travis/swag-gonic/gin-swagger/master.svg)](https://travis-ci.org/swag-gonic/gin-swagger)
[![Codecov branch](https://img.shields.io/codecov/c/github/swag-gonic/gin-swagger/master.svg)](https://codecov.io/gh/swag-gonic/gin-swagger)
[![Go Report Card](https://goreportcard.com/badge/github.com/swag-gonic/gin-swagger)](https://goreportcard.com/report/github.com/swag-gonic/gin-swagger)
[![Travis branch](https://img.shields.io/travis/swaggo/gin-swagger/master.svg)](https://travis-ci.org/swaggo/gin-swagger)
[![Codecov branch](https://img.shields.io/codecov/c/github/swaggo/gin-swagger/master.svg)](https://codecov.io/gh/swaggo/gin-swagger)
[![Go Report Card](https://goreportcard.com/badge/github.com/swaggo/gin-swagger)](https://goreportcard.com/report/github.com/swaggo/gin-swagger)
## Usage
### Start using it
1. Add comments to your API source code, [See Declarative Comments Format](https://github.com/swag-gonic/swag#declarative-comments-format).
2. Download [Swag](https://github.com/swag-gonic/swag) for Go by using:
1. Add comments to your API source code, [See Declarative Comments Format](https://github.com/swaggo/swag#declarative-comments-format).
2. Download [Swag](https://github.com/swaggo/swag) for Go by using:
```sh
$ go get -u github.com/swag-gonic/swag
$ go get -u github.com/swaggo/swag
```
3. Run the [Swag](https://github.com/swag-gonic/swag) in your Go project root folder which contains `main.go` file, [Swag](https://github.com/swag-gonic/swag) will parse comments and generate required files(`docs` folder and `docs/doc.go`).
3. Run the [Swag](https://github.com/swaggo/swag) in your Go project root folder which contains `main.go` file, [Swag](https://github.com/swaggo/swag) will parse comments and generate required files(`docs` folder and `docs/doc.go`).
```sh
$ swag init
```
4.Import following in your code:
```go
import "github.com/swag-gonic/gin-swagger" // gin-swagger middleware
import "github.com/swag-gonic/gin-swagger/swaggerFiles" // swagger embed files
import "github.com/swaggo/gin-swagger" // gin-swagger middleware
import "github.com/swaggo/gin-swagger/swaggerFiles" // swagger embed files
```
@@ -35,10 +35,10 @@ package main
import (
"github.com/gin-gonic/gin"
"github.com/swag-gonic/gin-swagger"
"github.com/swag-gonic/gin-swagger/swaggerFiles"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
_ "github.com/swag-gonic/gin-swagger/example/docs" // docs is generated by Swag CLI, you have to import it.
_ "github.com/swaggo/gin-swagger/example/docs" // docs is generated by Swag CLI, you have to import it.
)
// @title Swagger Example API