code: func yaml_emitter_emit_stream_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
  	if event.typ != yaml_STREAM_START_EVENT {
  		return yaml_emitter_set_emitter_error(emitter, "expected STREAM-START")
  	}
  	if emitter.encoding == yaml_ANY_ENCODING {
  		emitter.encoding = event.encoding
  		if emitter.encoding == yaml_ANY_ENCODING {
  			emitter.encoding = yaml_UTF8_ENCODING
  		}
  	}
  	if emitter.best_indent < 2 || emitter.best_indent > 9 {
  		emitter.best_indent = 2
  	}
  	if emitter.best_width >= 0 && emitter.best_width <= emitter.best_indent*2 {
  		emitter.best_width = 80
  	}
  	if emitter.best_width < 0 {
  		emitter.best_width = 1<<31 - 1
  	}
  	if emitter.line_break == yaml_ANY_BREAK {
  		emitter.line_break = yaml_LN_BREAK
  	}
  
  	emitter.indent = -1
  	emitter.line = 0
  	emitter.column = 0
  	emitter.whitespace = true
  	emitter.indention = true
  
  	if emitter.encoding != yaml_UTF8_ENCODING {
  		if !yaml_emitter_write_bom(emitter) {
  			return false
  		}
  	}
  	emitter.state = yaml_EMIT_FIRST_DOCUMENT_START_STATE
  	return true
  }
docs: // Expect STREAM-START.