{"id":51063,"library":"h2non-gock-v1","title":"gock","description":"A Go HTTP mocking library for testing HTTP clients with easy-to-use interceptors.","status":"active","version":"1.1.2","language":"go","source_language":null,"source_url":null,"tags":["http","testing","mock","interceptor"],"install":[{"cmd":"go get gopkg.in/h2non/gock.v1","lang":"bash","label":"Install gopkg.in/h2non/gock.v1"}],"dependencies":[],"imports":[{"symbol":"gock","correct":"gopkg.in/h2non/gock.v1"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"gopkg.in/h2non/gock.v1\"\n)\n\nfunc main() {\n\tdefer gock.Off()\n\tgock.New(\"http://example.com\").Get(\"/foo\").Reply(200).BodyString(\"bar\")\n\tresp, _ := http.Get(\"http://example.com/foo\")\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tfmt.Println(string(body))\n}","lang":"go","description":"Mock an HTTP GET request and verify the response."},"warnings":[],"env_vars":null,"search_vec":"'client':10 'easi':13 'easy-to-us':12 'go':3 'gock':1 'http':4,9,17 'interceptor':16,20 'librari':6 'mock':5,19 'test':8,18 'use':15","created_at":"2026-06-15T05:58:39.224085+00:00","updated_at":"2026-06-15T05:58:39.224085+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/h2non/gock","github":null,"docs":"https://pkg.go.dev/gopkg.in/h2non/gock.v1#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}