title: illegal base64 data error message
body: <p>I'm building an API that accepts JSON data POSTed to it.</p>
  
  <p>I have the following <code>user</code> struct and recently I changed the <code>password</code> datatype to <code>[]byte</code> from <code>string</code> so that it "plays nicely" with the bcrypt package.</p>
  
  <pre><code>type User struct {
      Id           string             `json:"id,omitempty"`
      Email        string             `json:"email,omitempty"`
      Username     string             `json:"username,omitempty"`
      Password     []byte             `json:"password,omitempty"`
      Name         string             `json:"name,omitempty"`
  }
  </code></pre>
  
  <p>However, I'm now getting an internal error returned in the JSON response <strong>illegal base64 data at input byte 4</strong> when a user is POSTed with a password of 5 or more characters to the API. There are no issues if the password is 4 or less characters.</p>
  
  <p>I've pinpointed the error to this block of code:</p>
  
  <pre><code>err := json.NewDecoder(req.Body).Decode(User)
  if err != nil &amp;&amp; err != io.EOF {
      return err
  }
  </code></pre>
  
  <p>Any ideas on a fix?</p>