INNER CODE UNIT · Go

openEditor

asciimoo/wuzz · commands.go:231

func openEditor(g *gocui.Gui, v *gocui.View, editor string) error {
	file, err := ioutil.TempFile(os.TempDir(), "wuzz-")
	if err != nil {
		return nil
	}
	defer os.Remove(file.Name())

	val := getViewValue(g, v.Name())
	if val != "" {
		fmt.Fprint(file, val)
	}
	file.Close()

	info, err := os.Stat(file.Name())
	if err != nil {
		return nil
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…