{"id":22994228,"url":"https://github.com/yangfei4913438/gotools","last_synced_at":"2025-08-13T22:31:30.364Z","repository":{"id":57527291,"uuid":"79678946","full_name":"yangfei4913438/gotools","owner":"yangfei4913438","description":"A Golang base module. ","archived":false,"fork":false,"pushed_at":"2019-08-13T05:51:49.000Z","size":94,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T07:21:56.132Z","etag":null,"topics":["go","golang","gotools","yangfei","yangfei4913438"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yangfei4913438.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-01-21T23:13:11.000Z","updated_at":"2025-02-06T04:52:20.000Z","dependencies_parsed_at":"2022-09-18T04:40:34.681Z","dependency_job_id":null,"html_url":"https://github.com/yangfei4913438/gotools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yangfei4913438/gotools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangfei4913438%2Fgotools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangfei4913438%2Fgotools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangfei4913438%2Fgotools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangfei4913438%2Fgotools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangfei4913438","download_url":"https://codeload.github.com/yangfei4913438/gotools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangfei4913438%2Fgotools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270329092,"owners_count":24565770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","gotools","yangfei","yangfei4913438"],"created_at":"2024-12-15T05:17:32.911Z","updated_at":"2025-08-13T22:31:30.118Z","avatar_url":"https://github.com/yangfei4913438.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Tools [![wercker status](https://app.wercker.com/status/5fcc7df5c1d51417a43c381aa0ec3de6/s/master \"wercker status\")](https://app.wercker.com/project/byKey/5fcc7df5c1d51417a43c381aa0ec3de6)\n\nThe role of the project: as the basis of other golang project module.\n\n## How to install\nUse `go get` to install or upgrade (`-u`) the `gotools` package.\n\n    go get -u github.com/yangfei4913438/gotools\n\n## Usage\nBase Example: \n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/yangfei4913438/gotools/base\"\n\t\"github.com/yangfei4913438/gotools/network\"\n)\n\nfunc main() {\n\tsh_out, sh_err := base.ShExec(\"\", \"ls\", \"-l\")\n\tif sh_err != nil {\n\t\tfmt.Println(\"error: \", sh_err.Error())\n\t} else {\n\t\tfmt.Println(\"out: \", sh_out)\n\t}\n\n\tfmt.Println(base.ErrorCustom(\"自定义错误信息\").Error())\n\n\t//获取token,默认32个随机值\n\tfmt.Println(base.GetToken(32, false))\n\n\t//获取token,将32个随机值用MD5进行加密\n\tfmt.Println(base.GetToken(32, true))\n\n\t//这里写的download相对路径，需要创建真实目录\n\tnetwork.UrlDownload(\"download\", \"http://dldir1.qq.com/qqfile/QQforMac/QQ_V5.4.1.dmg\")\n\n\t//求哈希值\n\tfmt.Println(base.StrMD5(\"hello\"))\n\tfmt.Println(base.StrSHA1(\"hello\"))\n\tfmt.Println(base.StrSHA256(\"hello\"))\n\tfmt.Println(base.StrSHA512(\"hello\"))\n}\n```\n\nInfo Example: \n    \n    Please be patient...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangfei4913438%2Fgotools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyangfei4913438%2Fgotools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangfei4913438%2Fgotools/lists"}