f.Write instead of io.WriteString (suggestion 2 from Stephen Day)