You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: editor_unix.go
    path of file: ./repos/sliver/vendor/github.com/reeflective/readline/internal/editor
    
    the code of the file until where you have to start completion: //go:build !windows && !plan9

package editor

import (
	"errors"
	"fmt"
	"os"
	"os/exec"
)

// ErrStart indicates that the command to start the editor failed.
var ErrStart = errors.New("failed t
    
func (reg *Buffers) EditBuffer(buf []rune, filename, filetype string, emacs bool) ([]rune, error) {
	name, err := writeToFile([]byte(string(buf)), filename)
	if err != nil {
		return buf, err
	}

	editor := getSystemEditor(emacs)

	args := []string{}
	if filetype != "" {
		args = append(args, fmt.Sprintf("-c 'set filetype=%s", filetype))
	}

	args = append(args, name)

	cmd := exec.Command(editor, args...)

	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	if err = cmd.Start(); err != nil {
		return buf, fmt.Errorf("%w: %s", ErrStart, err.Error())
	}

	if err = cmd.Wait(); err != nil {
		return buf, fmt.Errorf("%w: %s", ErrStart, err.Error())
	}

	b, err := readTempFile(name)

	return []rune(string(b)), err
}