code: func TSVEncode(values []KV) ([]byte, Encoding) {
  	var bufsize int
  	var hasbinary bool
  	for _, kv := range values {
  		// length of key
  		hasbinary = hasbinary || hasBinary(kv.Key)
  		bufsize += base64.StdEncoding.EncodedLen(len(kv.Key))
  		// tab
  		bufsize += 1
  		// value
  		hasbinary = hasbinary || hasBinarySlice(kv.Value)
  		bufsize += base64.StdEncoding.EncodedLen(len(kv.Value))
  		// newline
  		bufsize += 1
  	}
  	buf := make([]byte, bufsize)
  	var n int
  	for _, kv := range values {
  		if hasbinary {
  			base64.StdEncoding.Encode(buf[n:], []byte(kv.Key))
  			n += base64.StdEncoding.EncodedLen(len(kv.Key))
  		} else {
  			n += copy(buf[n:], kv.Key)
  		}
  		buf[n] = '\t'
  		n++
  		if hasbinary {
  			base64.StdEncoding.Encode(buf[n:], kv.Value)
  			n += base64.StdEncoding.EncodedLen(len(kv.Value))
  		} else {
  			n += copy(buf[n:], kv.Value)
  		}
  		buf[n] = '\n'
  		n++
  	}
  	enc := IdentityEnc
  	if hasbinary {
  		enc = Base64Enc
  	}
  	return buf, enc
  }
docs: // Encode the request body in TSV. The encoding is chosen based
  // on whether there are any binary data in the key/values