gencebay / httplive

HTTP Request & Response Service, Mock HTTP
MIT License
1.14k stars 58 forks source link

go get failed. #1

Closed donnol closed 6 years ago

donnol commented 6 years ago

When I go get github.com/gencebay/httplive, it failed with:

# github.com/gencebay/httplive/lib
go/src/github.com/gencebay/httplive/lib/controller.go:106:13: c.ShouldBindJSON undefined (type 
*gin.Context has no field or method ShouldBindJSON)
go/src/github.com/gencebay/httplive/lib/controller.go:122:13: c.ShouldBindJSON undefined (type 
*gin.Context has no field or method ShouldBindJSON)
lndj commented 6 years ago

+1

aimof commented 6 years ago

c.ShouldBindJson method was added 3 months ago. I guess your gin repo is old one.

case your gin repo is old.

# in $GOPATH/src/github.com/gin-gonic/gin
$ git reset --hard b8b6831
HEAD is now at b8b6831 feat: add multiple service example. (#1119)
$ go get github.com/gencebay/httplive
# github.com/gencebay/httplive/lib
../../gencebay/httplive/lib/controller.go:106:13: c.ShouldBindJSON undefined (type *gin.Context has no field or method ShouldBindJSON)
../../gencebay/httplive/lib/controller.go:122:13: c.ShouldBindJSON undefined (type *gin.Context has no field or method ShouldBindJSON)

to solve

You can do this.

go get -u github.com/gencebay/httplive

If you do this command, your gin repo is updated and you can go get httplive. (This command may cause a dependency problem)

playmyswift commented 6 years ago

+1

donnol commented 6 years ago

It work. Thanks. @aimof