title: Unmarshalling JSON with invalid character
body: <p>I have json coming in from a web service which can potentially be invalid for json unmarshalling due to it being human entered values. I also don't have control over these values because they come in through an external API. Is there a clean way to sanitize the input to remove all invalid values from a <code>[]byte</code> before unmarshalling to a struct?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "encoding/json"
  )
  
  type Test struct {
      Field string `json:"test"`
  }
  
  func main() {
      test := `{"test": " "}` //this is a tab character
      obj := Test{}
      if err := json.Unmarshal([]byte(test) , &amp;obj); err != nil {
          fmt.Printf("%v", err)
      }
  }
  </code></pre>
  
  <p>And then the returned error for this is: </p>
  
  <p><code>invalid character '\t' in string literal</code></p>