<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Troubleshooting on 艺术码农的小栈</title><link>https://itart.cn/tags/troubleshooting.html</link><description>Recent content in Troubleshooting on 艺术码农的小栈</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 24 Nov 2021 10:52:45 +0800</lastBuildDate><atom:link href="https://itart.cn/tags/troubleshooting/index.xml" rel="self" type="application/rss+xml"/><item><title>Go httptest WriteHeader无效问题</title><link>https://itart.cn/blogs/2021/troubleshooting/httptest-writeheader-invalid.html</link><pubDate>Wed, 24 Nov 2021 10:52:45 +0800</pubDate><guid>https://itart.cn/blogs/2021/troubleshooting/httptest-writeheader-invalid.html</guid><description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;测试一个调用http接口时，使用了httptest.NewServer来mock一个http服务端，在验证响应异常状态码时发现奇怪问题，明明设置了异常状态码，但是http.Get始终返回的状态码都是正常的200：&lt;/p&gt;</description></item></channel></rss>