{"id":37418376,"url":"https://github.com/gaols/goutils","last_synced_at":"2026-01-16T06:03:19.376Z","repository":{"id":57489992,"uuid":"115172089","full_name":"gaols/goutils","owner":"gaols","description":"Let goutils to accelerate your dev speed","archived":false,"fork":false,"pushed_at":"2020-01-17T03:36:04.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T23:45:00.479Z","etag":null,"topics":["go-utils","golang-utils","goutils"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaols.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-23T05:08:25.000Z","updated_at":"2020-01-17T03:34:49.000Z","dependencies_parsed_at":"2022-08-29T19:31:28.337Z","dependency_job_id":null,"html_url":"https://github.com/gaols/goutils","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gaols/goutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaols%2Fgoutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaols%2Fgoutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaols%2Fgoutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaols%2Fgoutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaols","download_url":"https://codeload.github.com/gaols/goutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaols%2Fgoutils/sbom","scorecard":{"id":418429,"data":{"date":"2025-08-11","repo":{"name":"github.com/gaols/goutils","commit":"6e129047ea6f9a8a17bea4c0c3d93f2a382f457b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0229 / GHSA-cjjc-xp8v-855w","Warn: Project is vulnerable to: GO-2020-0012 / GHSA-ffhg-7mh4-33c4","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T00:31:39.524Z","repository_id":57489992,"created_at":"2025-08-19T00:31:39.524Z","updated_at":"2025-08-19T00:31:39.524Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","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-utils","golang-utils","goutils"],"created_at":"2026-01-16T06:03:19.194Z","updated_at":"2026-01-16T06:03:19.369Z","avatar_url":"https://github.com/gaols.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goutils\n\n## Description\n\nSome common utilities to make your development more productive.\n\n## Install\n\n```shell\ngo get github.com/gaols/goutils\n```\n\n## utilities\n\n### stringutils\n\nif you come from Java, you should familiar with the those apis. It's the go implementation of\napache commons for string manipulation.\n\n```go\nimport \"github.com/gaols/goutils\"\n\ngoutils.Reverse(\"fox\")                // out: xof\ngoutils.LeftPad(\"fox\", 5, 'z')        // out: zzfox\ngoutils.RightPad(\"fox\", 5, 'z')       // out: foxzz\ngoutils.IsBlank(\" \")                  // out: true\ngoutils.IsBlank(\"a\")                  // out: false\ngoutils.IsEmpty(\"\")                   // out: true\ngoutils.IsEmpty(\" \")                  // out: false\ngoutils.DefaultIfBlank(\" \", \"hello\")  // out: hello\ngoutils.DefaultIfBlank(\"c\", \"hello\")  // out: c\ngoutils.DefaultIfEmpty(\"\", \"hello\")   // out: hello\ngoutils.DefaultIfEmpty(\"c\", \"hello\")  // out: c\ngoutils.Substring(\"hello\", 0, 1)      // out: h\ngoutils.IsAnyBlank(\"hello\", \"\")       // out: true\ngoutils.IsAnyBlank(\"hello\")           // out: false\n```\n\n### dateutils\n\ndate utils has a lot of date related sugar methods.\n\n```go\ngoutils.Today()\ngoutils.Yesterday()\ngoutils.BeginningOfThisWeek()\ngoutils.BeginningOfThisMonth()\ngoutils.BeginningOfThisYear()\ngoutils.LastWeek()\ngoutils.LastMonth()\ngoutils.LastYear()\n// ... and many others\n```\n\n### timeutils\n\n```go\n// assumes time now is: 2017-12-27 21:15:15\ngoutils.FmtTime(time.Now(), \"-datetime\")      // out: 2017-12-27 21:15:15\ngoutils.FmtTime(time.Now(), \"-datetime-\")     // out: 2017-12-27 21:15\ngoutils.FmtTime(time.Now(), \"-datetime--\")    // out: 2017-12-27 21\ngoutils.FmtTime(time.Now(), \"-date\")          // out: 2017-12-27\ngoutils.FmtTime(time.Now(), \"time\")           // out: 21:15:15\ngoutils.FmtTime(time.Now(), \"time-\")          // out: 21:15\ngoutils.FmtTime(time.Now(), \"time--\")         // out: 21\n\ngoutils.FmtTime(time.Now(), \"/datetime\")      // out: 2017/12/27 21:15:15\ngoutils.FmtTime(time.Now(), \"/datetime-\")     // out: 2017/12/27 21:15\ngoutils.FmtTime(time.Now(), \"/datetime--\")    // out: 2017/12/27 21\ngoutils.FmtTime(time.Now(), \"/date\")          // out: 2017/12/27\n\ngoutils.FmtTime(time.Now(), \".datetime\")      // out: 2017.12.27 21:15:15\ngoutils.FmtTime(time.Now(), \".datetime-\")     // out: 2017.12.27 21:15\ngoutils.FmtTime(time.Now(), \".datetime--\")    // out: 2017.12.27 21\ngoutils.FmtTime(time.Now(), \".date\")          // out: 2017.12.27\n\ngoutils.FmtTime(time.Now(), \"xzzz\")           // error\ngoutils.MustFmtTime(time.Now(), \"xzzz\")       // panic\ngoutils.MustParseTime(\"2017-12-27\", \"-date\")  // time object@2017-12-27\n```\n\n## terminal color utils\n\n```go\ngoutils.GreenText(\"%s is very cool\", \"something\")\ngoutils.RedText(\"this text will be red\")\n```\n\nif more colorized text is required, use [github.com/fatih/color](github.com/fatih/color) instead.\n\n## input utils\n\n`goutils.Confirm` will block the program and force user to make a choice before doing any other things. \n\n```go\ngoutils.Confirm(\"are you sure(y/n)?\", []string {\"y\"}, []string {\"n\"}, func() {\n  // do something when user input 'n'\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaols%2Fgoutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaols%2Fgoutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaols%2Fgoutils/lists"}