code: func (du *DataURL) WriteTo(w io.Writer) (n int64, err error) {
  	var ni int
  	ni, _ = fmt.Fprint(w, "data:")
  	n += int64(ni)
  
  	ni, _ = fmt.Fprint(w, du.MediaType.String())
  	n += int64(ni)
  
  	if du.Encoding == EncodingBase64 {
  		ni, _ = fmt.Fprint(w, ";base64")
  		n += int64(ni)
  	}
  
  	ni, _ = fmt.Fprint(w, ",")
  	n += int64(ni)
  
  	if du.Encoding == EncodingBase64 {
  		encoder := base64.NewEncoder(base64.StdEncoding, w)
  		ni, err = encoder.Write(du.Data)
  		if err != nil {
  			return
  		}
  		encoder.Close()
  	} else if du.Encoding == EncodingASCII {
  		ni, _ = fmt.Fprint(w, Escape(du.Data))
  		n += int64(ni)
  	} else {
  		err = fmt.Errorf("dataurl: invalid encoding %s", du.Encoding)
  		return
  	}
  
  	return
  }
docs: // WriteTo implements the WriterTo interface.
  // See the note about String().