Customizing errors based on HTTP status code in golang
Your code is fine, but don't use fmt.Fprintf if you don't need formatting.
It will scan your string for placeholders (like %s):
fmt.Fprintf(os.Stdout, &quot;100%sure&quot;)
// 100%!s(MISSING)ure

Use Write directly:
os.Stdout.Write([]byte(&quot;100%sure&quot;))
// 100%sure

And don't forget to handle returned error.
A bit more about io.Writer
Quote from documentation:

Writer is the interface that wraps the basic Write method.
Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 &lt;= n &lt;= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n &lt; len(p). Write must not modify the slice data, even temporarily.

I guess that implementations of Write method are encouraged to write all data in a single call. If we digg the sources a bit we'll find, that under the hood most Write methods are implemented with loops.
On the other hand io.Reader may return with partial read and nil error, so methods like io.ReadFull and ioutil.ReadAll are quite handy.