deprecated.go 881 B

12345678910111213141516171819202122232425
  1. // Copyright 2014 Manu Martinez-Almeida. All rights reserved.
  2. // Use of this source code is governed by a MIT style
  3. // license that can be found in the LICENSE file.
  4. package gin
  5. import (
  6. "github.com/gin-gonic/gin/binding"
  7. "log"
  8. )
  9. func (c *Context) GetCookie(name string) (string, error) {
  10. log.Println("GetCookie() method is deprecated. Use Cookie() instead.")
  11. return c.Cookie(name)
  12. }
  13. // BindWith binds the passed struct pointer using the specified binding engine.
  14. // See the binding package.
  15. func (c *Context) BindWith(obj interface{}, b binding.Binding) error {
  16. log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to
  17. be deprecated, please check issue #662 and either use MustBindWith() if you
  18. want HTTP 400 to be automatically returned if any error occur, of use
  19. ShouldBindWith() if you need to manage the error.`)
  20. return c.MustBindWith(obj, b)
  21. }