{"id":13413645,"url":"https://github.com/hashicorp/go-cleanhttp","last_synced_at":"2025-05-13T20:18:06.810Z","repository":{"id":37951376,"uuid":"44763892","full_name":"hashicorp/go-cleanhttp","owner":"hashicorp","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-03T16:06:47.000Z","size":27,"stargazers_count":397,"open_issues_count":4,"forks_count":36,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-05T19:04:37.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/hashicorp/go-cleanhttp","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-22T18:07:48.000Z","updated_at":"2025-05-01T01:51:47.000Z","dependencies_parsed_at":"2024-12-24T10:09:43.239Z","dependency_job_id":"1a3a63eb-0672-464c-884a-7074bb8f2481","html_url":"https://github.com/hashicorp/go-cleanhttp","commit_stats":{"total_commits":22,"total_committers":9,"mean_commits":"2.4444444444444446","dds":"0.40909090909090906","last_synced_commit":"ff862fda8e09aad1244501dcf5038fdc7788fed2"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-cleanhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-cleanhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-cleanhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-cleanhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/go-cleanhttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752061,"owners_count":21798723,"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-07-30T20:01:45.314Z","updated_at":"2025-05-13T20:18:06.791Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","readme":"# cleanhttp\n\nFunctions for accessing \"clean\" Go http.Client values\n\n-------------\n\nThe Go standard library contains a default `http.Client` called\n`http.DefaultClient`. It is a common idiom in Go code to start with\n`http.DefaultClient` and tweak it as necessary, and in fact, this is\nencouraged; from the `http` package documentation:\n\n\u003e The Client's Transport typically has internal state (cached TCP connections),\nso Clients should be reused instead of created as needed. Clients are safe for\nconcurrent use by multiple goroutines.\n\nUnfortunately, this is a shared value, and it is not uncommon for libraries to\nassume that they are free to modify it at will. With enough dependencies, it\ncan be very easy to encounter strange problems and race conditions due to\nmanipulation of this shared value across libraries and goroutines (clients are\nsafe for concurrent use, but writing values to the client struct itself is not\nprotected).\n\nMaking things worse is the fact that a bare `http.Client` will use a default\n`http.Transport` called `http.DefaultTransport`, which is another global value\nthat behaves the same way. So it is not simply enough to replace\n`http.DefaultClient` with `\u0026http.Client{}`.\n\nThis repository provides some simple functions to get a \"clean\" `http.Client`\n-- one that uses the same default values as the Go standard library, but\nreturns a client that does not share any state with other clients.\n","funding_links":[],"categories":["网络","Networking","Middlewares \u0026 framework add-ons","Go"],"sub_categories":["HTTP客户端","HTTP Clients"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-cleanhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fgo-cleanhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-cleanhttp/lists"}