<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Testing on Nalar</title>
    <link>https://nalar.dev/tags/testing/</link>
    <description>Recent content in Testing on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/testing/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Testing Go HTTP Handlers with httptest</title>
      <link>https://nalar.dev/testing-go-http-handlers-with-httptest/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/testing-go-http-handlers-with-httptest/</guid>
      <description>&lt;p&gt;HTTP handlers are one of the easiest parts of a Go service to test well. You usually do not need to bind a real network port, start the entire application, or depend on an external test framework.&lt;/p&gt;&#xA;&lt;p&gt;Go&amp;rsquo;s standard library provides &lt;code&gt;net/http/httptest&lt;/code&gt;, which can construct HTTP requests, capture handler responses, and even start temporary HTTP servers when a real client-server round trip matters.&lt;/p&gt;&#xA;&lt;p&gt;This guide builds a small JSON endpoint and tests it at several useful levels.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
