Fixed Lint Error

This commit is contained in:
Medzik 2021-07-14 12:00:17 +02:00
parent deca65708c
commit 94b0a800cb
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,3 @@
package config
var Version = "1.0.0-beta.3"
var Version = "1.0.0"

View File

@ -9,9 +9,6 @@ import (
)
func Delete(c *gin.Context) {
var post URLType
c.BindJSON(&post)
url := c.Param("url")
d, err := base64.StdEncoding.DecodeString(url)

View File

@ -9,7 +9,15 @@ import (
func Insert(c *gin.Context) {
var post URLType
c.BindJSON(&post)
err := c.BindJSON(&post)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"success": false,
"message": "Error Binding JSON!",
})
return
}
if len(post.URL) < 1 {
c.JSON(http.StatusBadRequest, gin.H{
@ -20,7 +28,7 @@ func Insert(c *gin.Context) {
return
}
_, err := http.Get(post.URL)
_, err = http.Get(post.URL)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"success": false,