mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
Fixed Lint Error
This commit is contained in:
parent
deca65708c
commit
94b0a800cb
3 changed files with 11 additions and 6 deletions
|
@ -1,3 +1,3 @@
|
|||
package config
|
||||
|
||||
var Version = "1.0.0-beta.3"
|
||||
var Version = "1.0.0"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue