{"id":37216027,"url":"https://github.com/hasanaliqureshi/go-validation","last_synced_at":"2026-01-15T00:58:55.678Z","repository":{"id":61627525,"uuid":"159772708","full_name":"hasanaliqureshi/Go-Validation","owner":"hasanaliqureshi","description":"Text and Input Validation in Golang","archived":false,"fork":false,"pushed_at":"2018-12-01T13:36:23.000Z","size":6,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T13:12:48.989Z","etag":null,"topics":["go","golang","golang-application","input-validation","learning-by-doing","validation","validation-library"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hasanaliqureshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-30T05:23:37.000Z","updated_at":"2024-01-04T10:45:05.000Z","dependencies_parsed_at":"2022-10-18T17:45:30.999Z","dependency_job_id":null,"html_url":"https://github.com/hasanaliqureshi/Go-Validation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hasanaliqureshi/Go-Validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasanaliqureshi%2FGo-Validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasanaliqureshi%2FGo-Validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasanaliqureshi%2FGo-Validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasanaliqureshi%2FGo-Validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasanaliqureshi","download_url":"https://codeload.github.com/hasanaliqureshi/Go-Validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasanaliqureshi%2FGo-Validation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"ssl_error","status_checked_at":"2026-01-15T00:55:20.945Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-application","input-validation","learning-by-doing","validation","validation-library"],"created_at":"2026-01-15T00:58:55.000Z","updated_at":"2026-01-15T00:58:55.665Z","avatar_url":"https://github.com/hasanaliqureshi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Image of Yaktocat](https://www.devteam.space/wp-content/uploads/2017/03/gopher_head-min.png\n)\n\n# Text and Input Validation in Golang\n\nI've created this helping script for my APIs to deal with user inputs. Just clone the repo and use it in your project.\n\n## Usage:\n\n1. Define the validator\n\n  `\n  userInput := validator(\"blah!blah!blah!\")\n  `\n\n2. Apply the methods\n\n   `userInput.Required().oneLowerCase().check()`     `// will return true or false` \n\n\n\n## Methods\n\nuse `.check()` after all methods to return the `boolean` value, otherwise the method will return `type struct`\n\n| Methods            | Descrption                                                   |\n| ------------------ | :----------------------------------------------------------- |\n| Required()         | returns `false` if input is empty                            |\n| minLength(int)     | returns `false` if input is less than provided minimum value |\n| maxLength(int)     | returns `false` if input is greater than provided maximum value |\n| isEmail            | return `false` if input is not an email address              |\n| oneLowerCase       | return `false` if input value doesn't have at least one lowercase character |\n| allLowerCase       | return `false`if input value doesn't have all lowercase characters |\n| oneUpperCase       | return `false` if input value doesn't have at least one uppercase character |\n| allUpperCase       | return `false` if input value doesn't have all uppercase characters |\n| oneNumber          | return `false` if input value doesn't have at least one number character |\n| isSpecialCharacter | return `false` if input value doesn't have at least one special character |\n\n## Using Multiple Methods:\n\nI've design the methods in a way that multiple methods can be used in a line.\n\nFor example to check for a strong password you can use.\n\n`userInput.minLength(8).oneLowerCase().oneUpperCase().oneNumber().isSpecialCharacter().check()`\n\nThe above code will check for the applied methods and will return boolean `false` if any method doesn't validate the password.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasanaliqureshi%2Fgo-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasanaliqureshi%2Fgo-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasanaliqureshi%2Fgo-validation/lists"}