Skip to content

Commit

Permalink
fix: variables in the assignment caused compile error (swaggo#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
easonlin404 authored Jul 10, 2019
1 parent 288d21c commit c8a5281
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions example/basic/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ import (
// @Failure 404 {object} web.APIError "Can not find ID"
// @Router /testapi/get-string-by-int/{some_id} [get]
func GetStringByInt(c *gin.Context) {
_ := web.Pet{}
//write your code
var pet web.Pet
if err := c.ShouldBindJSON(&pet); err != nil {
// write your code
return
}

// write your code
}

// GetStructArrayByString example
Expand All @@ -35,7 +40,7 @@ func GetStringByInt(c *gin.Context) {
// @Failure 404 {object} web.APIError "Can not find ID"
// @Router /testapi/get-struct-array-by-string/{some_id} [get]
func GetStructArrayByString(c *gin.Context) {
//write your code
// write your code
}

// Upload example
Expand All @@ -50,7 +55,7 @@ func GetStructArrayByString(c *gin.Context) {
// @Failure 404 {object} web.APIError "Can not find ID"
// @Router /file/upload [post]
func Upload(ctx *gin.Context) {
//write your code
// write your code
}

// AnonymousField example
Expand Down

0 comments on commit c8a5281

Please sign in to comment.