Skip to content

Instantly share code, notes, and snippets.

@victorsteven
Created January 19, 2020 21:17
package controller
import (
"errors"
"github.com/gin-gonic/gin"
"net/http"
"username_across_platforms/server/service"
)
func Username(c *gin.Context) {
var urls []string
if err := c.ShouldBindJSON(&urls); err != nil {
c.JSON(http.StatusUnprocessableEntity, errors.New("invalid json body"))
return
}
matchedUrls := service.UsernameService.UsernameCheck(urls)
c.JSON(http.StatusOK, matchedUrls)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment