From a9094506fa91bd6e68dc6d448cf476fd67936f18 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 26 Jul 2018 10:10:39 +0200 Subject: [PATCH] cleanup --- models/helper.go | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 models/helper.go diff --git a/models/helper.go b/models/helper.go deleted file mode 100644 index b785878bb9f..00000000000 --- a/models/helper.go +++ /dev/null @@ -1,31 +0,0 @@ -package models - -import ( - "github.com/labstack/echo" - "strconv" -) - -// GetIntURLParam is a helper method which returns an int from an url param -func GetIntURLParam(param string, c echo.Context) (intParam int64, err error) { - - id := c.Param(param) - if id != "" { - intParam, err = strconv.ParseInt(id, 10, 64) - } - - return intParam, err -} - -// GetByID gets an object by its ID -func GetByID(id int64, result interface{}) (err error) { - exists, err := x.ID(id).Get(result) - if err != nil { - return err - } - - if !exists { - return ErrListDoesNotExist{} - } - - return -}