{"id":16476539,"url":"https://github.com/poneding/go","last_synced_at":"2025-02-28T11:43:59.015Z","repository":{"id":65732964,"uuid":"598190529","full_name":"poneding/go","owner":"poneding","description":"go package can use directly.","archived":false,"fork":false,"pushed_at":"2023-04-18T14:59:54.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T05:47:22.614Z","etag":null,"topics":[],"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/poneding.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":"2023-02-06T15:38:39.000Z","updated_at":"2023-02-06T15:39:49.000Z","dependencies_parsed_at":"2023-02-19T09:20:39.302Z","dependency_job_id":null,"html_url":"https://github.com/poneding/go","commit_stats":null,"previous_names":["srcio/go"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poneding%2Fgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poneding%2Fgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poneding%2Fgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poneding%2Fgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poneding","download_url":"https://codeload.github.com/poneding/go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241144815,"owners_count":19917357,"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","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":[],"created_at":"2024-10-11T12:42:52.588Z","updated_at":"2025-02-28T11:43:58.988Z","avatar_url":"https://github.com/poneding.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github.com/srcio/go\n\n本仓库中封装了一些 go 语言常用的工具函数，可以在日常开发中使用。\n\n下面是一些包的使用示例。\n\n## conc\n\n- 并发运行多个函数，会开启相应数量的 goroutine\n\n```go\nconc.Run(func() {\n    fmt.Println(\"Hello\")\n}, func() {\n    fmt.Println(\"World\")\n})\n```\n\n- 并发运行多个函数，并且等待所有函数完成\n\n```go\nconc.Wait(func() {\n    time.Sleep(1 * time.Second)\n    fmt.Println(\"Hello\")\n}, func() {\n    time.Sleep(4 * time.Second)\n    fmt.Println(\"World\")\n})\n```\n\n- 并发运行多个函数，并且捕获 panic\n\n```go\nif p := conc.WaitAndRecover(func() {\nfmt.Println(\"Hello\")\npanic(\"panic when print hello\")\n}, func() {\n    fmt.Println(\"World\")\n    time.Sleep(1 * time.Second)\n    panic(\"panic when print world\")\n}); p != nil {\n    fmt.Printf(\"p.PanicInfo(): %v\\n\", p.PanicInfo())\n    fmt.Printf(\"p.PanicVal(): %v\\n\", p.PanicVal())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponeding%2Fgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fponeding%2Fgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponeding%2Fgo/lists"}