{"version":"1.0","type":"rich","title":"go handler test example","description":"This example demonstrates testing Go HTTP handlers using the standard library’s `net/http/httptest` package. It shows a homepage handler that returns content from a repository interface and a post handler that echoes a form value, with tests verifying their responses. The code uses `httptest.NewRecorder` to capture responses, `http.NewRequest` to build requests, and URL-encoded form data for POST parameters. A test repository replaces the real implementation to provide deterministic output.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-77a72b8d2427249f8110d3a48a94925f?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}