Skip to content

Commit

Permalink
refactor(service.url): make validateURLInput public
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Apr 5, 2021
1 parent ce1fefc commit 85c9194
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/url/client.go
Expand Up @@ -31,7 +31,7 @@ func CreateURLShortCodeFromRequest(req *http.Request) (string, error) {
// CreateURLShortCode creates a new short code using request.URLInput
// It returns created short code or error if any.
func CreateURLShortCode(input request.URLInput) (string, error) {
if shortCode, err := validateURLInput(input); err != nil {
if shortCode, err := ValidateURLInput(input); err != nil {
return shortCode, err
}

Expand Down Expand Up @@ -95,7 +95,7 @@ func checkURLReach() bool {

// validateURLInput validates given request.URLInput
// It returns existing short code for input url if exists and validation error if any.
func validateURLInput(input request.URLInput) (string, error) {
func ValidateURLInput(input request.URLInput) (string, error) {
if err := input.Validate(); err != nil {
return "", err
}
Expand Down

0 comments on commit 85c9194

Please sign in to comment.